By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,877 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

Simple memory usage question

P: n/a
Hi,

A simple question...

This is just an example ... Say I have a class (MyClass) that has only
few variables (let's say 10 strings) but many-many-many subs and
fuctions, so many subs and functions that they take up 10k of memory.
The subs and fuctions creates no new variables.

Here's my question....

Will ....

Dim Class1 As New MyClass
Dim Class2 As New MyClass
Dim Class3 As New MyClass

Will they use 30k (due to the subs & functions) plus a small usage for
the 30 strings? .... or will they only use 10k plus a small usage for
the 30 strings?

In other words ... Will creating a new MyClass take 10k plus the strings
each time I create a new instance or will it only take 10k (plus the
strings) the first time I create an instance and all other instances
will use the same 10k of subs ans functions?

Than you!

M O J O

Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* M O J O <mojo@_no_spam_delete_this_newwebsolutions.dk> scripsit:
This is just an example ... Say I have a class (MyClass) that has only
few variables (let's say 10 strings) but many-many-many subs and
fuctions, so many subs and functions that they take up 10k of
memory. The subs and fuctions creates no new variables.

Here's my question....

Will ....

Dim Class1 As New MyClass
Dim Class2 As New MyClass
Dim Class3 As New MyClass

Will they use 30k (due to the subs & functions) plus a small usage for
the 30 strings? .... or will they only use 10k plus a small usage for
the 30 strings?


The latter.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
Thanks Herfried!!

M O J O

Herfried K. Wagner [MVP] wrote:
* M O J O <mojo@_no_spam_delete_this_newwebsolutions.dk> scripsit:
This is just an example ... Say I have a class (MyClass) that has only
few variables (let's say 10 strings) but many-many-many subs and
fuctions, so many subs and functions that they take up 10k of
memory. The subs and fuctions creates no new variables.

Here's my question....

Will ....

Dim Class1 As New MyClass
Dim Class2 As New MyClass
Dim Class3 As New MyClass

Will they use 30k (due to the subs & functions) plus a small usage for
the 30 strings? .... or will they only use 10k plus a small usage for
the 30 strings?

The latter.


Nov 20 '05 #3

P: n/a
Hi, M O J O,

Thanks for using Microsoft MSDN Managed Newsgroup.

It seems you have got the answer by MVP Herfried's reply, If you more
concerns on this topic, please feel free to reply this message, I will find
someone to help you on your issue.

Thanks!
Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.