Out of memory - insufficient variable space 
Author Message
 Out of memory - insufficient variable space

You might also look into the following:

1)      Every place you have a public ("Global") variable, look at the routines
which use it and ask if there is a good reason why the routines couldn't be
in the same module with the global variable, thus letting you declare it as
private ("Dim") instead.

2)      For every public sub or function, the same.

3)      For each and every occurence of "Global Const", substitute the value for
the name in all code referencing the constant (save the const name as a
remark immediately after its use).  Maintainability goes to shit,
however...

4)      I know it's lousy practice, but if you have, for example, a utility
function which is called from three or so modules, this being the excuse
for its being public at the moment, you can copy the routine in each of the
modules, declaring the copies Private in each module.  Your .EXE will be
larger, but your global name space will be smaller.

5)      Where you have functions which operate on the same general category of
data, taking the same arguments and returning the same types, you might
profit by coalescing the discrete functions into one large function, which
takes one additional parameter specifying the actual function you want
performed.  It might even be worth it to take the performance hit of using
Variants just so you can coalesce more routines, if it means the difference
between compiling or not.

6)      For scalar data you don't access a lot (meaning, no more than a couple
of times during an event), and where format is not critical, you can cut
down on your global name space requirements by the following:  Declare a
single global string, which will hold data in the format
"\KEY=value\KEY=value\KEY=value\...".  Write yourself a couple of utility
functions for extracting and assigning keys and values from the string
variable.  This can cut down significantly on the global name space load,
at the expense of more memory and CPU being used to store and access the
values, as well as the occasional heap compaction when you change a value.

7)      I'm not sure if you can decrease the global name space footprint by
using User-Defined Types or not, but it might be something to look at (that
is, gathering up your global scalar values as members of a user-defined
type, then declaring a global variable of that type and addressing its
members).  This would make your code more prolix (like I should talk,
huh?), but has less drawbacks than #6, above.

Hope this helps.

Clayton Jones



Sat, 13 Nov 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. out of memory - insufficient variable space vb 3.0

2. Out of Memory - Insufficient variable space

3. Out of Memory - Insufficient variable space

4. Help - Insufficient Variable Space

5. Insufficient Variable Space and a Large Project?

6. Out of Memory - insuff. variable space (VB3.0)

7. variable across different memory space

8. Space Space Space Space Space Space Space

9. Session Variable Time-outs

10. Space Space Space Space Space Space Space

11. Space Space Space Space Space Space Space

12. Error w/ VB 3.0 Enterprise: Out of memory - Insufficient Variable Space.

 

 
Powered by phpBB® Forum Software