Managing Resources

Smee

Well-Known Member
Licensed User
Longtime User
Hi,

When using multiple forms in a project is it more efficient use of memory/resources to define an instance of an object once and then re-use it in other forms or does it not make any difference to the size or resources the program uses.

For example is it better to code

Reader.New1
in it's own form

or

Form1.Reader.New1

Thanks

Joe
 

agraham

Expert
Licensed User
Longtime User
I'm not really sure what you are asking. Do you mean module rather than form? Every object that you New takes up memory regardless whether it is local or in another module. The fewer objects you have Newed (and not Disposed) the less memory you are using.
 

Smee

Well-Known Member
Licensed User
Longtime User
Thanks for the reply Andrew.

I have 3 modules each with their own form and i suspected that what you are saying was the case. I will now try to use less


thanks again

Joe
 
Top