Simple memory usage question

  • Thread starter Thread starter M O J O
  • Start date Start date
M

M O J O

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
 
* M O J O said:
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.
 
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.
--------------------
 
Back
Top