Well, it really depends on exactly what you are doing...
If you have something like this...
Procedure01 calls procedure02
Procedure02 calls procedure03
03 calls 04
04 calls 05
....
Then what you are doing is building up the stack space and thus you can see the memory expand.
However if you do something like this...
01 calls 02 and 02 returns to 01 (then pop off the stack it comes)
01 calls 03 and ....
then your memory will fluxuate up and down but not too seriously unless you keep building things up in memory... Meaning if you have lets say a string varible declared in the general declaration section of the form and your sub/functions keep adding to it.
So when you say your private variables are not being cleared when a sub is done, it leads me to belive that these variables are in the general declaration section.
Good Luck
vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
from vb's help file...
Project Limitations
A single project can contain up to 32,000 "identifiers" (any nonreserved keyword), which include, but are not limited to, forms, controls, modules, variables, constants, procedures, functions, and objects. Note that the actual number of identifiers is limited to available memory.
Variable names in Visual Basic can be no longer than 255 characters, and the names of forms, controls, modules, and classes cannot be longer than 40 characters. Visual Basic imposes no limit on the actual number of distinct objects in a project.
So I don't think you should be worried yet...
However, I would suggest that you break up your code some and perhaps move some of your forms code to modules.
Good Luck
vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
A single project can contain up to 32,000 "identifiers" (any nonreserved keyword), which include, but are not limited to, forms, controls, modules, variables, constants, procedures, functions, and objects. Note that the actual number of identifiers is limited to available memory.
Good Luck
vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296