Insufficient Variable Space and a Large Project? 
Author Message
 Insufficient Variable Space and a Large Project?

Hello There,
I've posted a similar message before but to comp.lang.basic.visual. At the
time, I did not know that clbv was a dying newsgroup which would explain the
lack of responses (none). Anyway, we're using the Professional Edition of VB
3.0 and we've got what I think is a large VB project (80 forms and 90 bas
files - and growing). Some of these forms are large in that one of the forms
has 112 controls in it. Also, some of the bas files are large in that some of
them span a little over 100K in size (including comments). As for complexity,
it's up there too in that we're using MS-Access as a temporary repository in
a client-server architecture. We're using our homegrown tools for
communicating to our Unix based servers for transferring data. This
middle-ware is accomplished via DLLS using WinSock. Also, FarPoint's
Tab/VBX v1.1 and Spread/VBX v2.1 are being used extensively.

The problem we're running into now is that whenever we try to add a new
form or bas file to the project and try to compile, VB gives an "Out of
Memory - Insufficient Variable Space" error. Hitting F1 when this error
comes up gives the following help:
Out of Memory - insufficient variable space

Error 3761

There are too many large variables in this module. Reduce the size of some
variables (declare them as a data type other than Variant), or make some ot
them into an array.

There is a known bug out there wherein if a variable named ClientTop, Left,
Right, etc. is declared and is a variant, this would happen. This I've
looked into already and we definitely are not doing this.

The symptom whenever this happens is that a form name is highlighted.
Commenting the line with the error will result in getting the same error on
a different line and again, the formname is highlighted. With this being the
symptom, I looked at a developer's "suspect" piece of code and saw that
forms were being passed as parameters left and right in bas files when
passing the specific controls would have sufficed. We went to the extreme by
getting rid of as many functions as possible that required forms as
parameters. We still have about 5 functions that require forms as parameters,
but we're planning on changing that. Also, with these 5 functions, using 'Me'
instead of the formname definitely helped. After this little exercise, we
were able to go on for a while and more forms and bas files were added to
the project. Now, we're in the same exact quandary and are running out of
ideas on how to deal with this problem. We're pretty much convinced that the
project is way too big for VB to handle. Could this be true?

Here's more background info:

Calling MS Premier support elicited the following:
- There's possibly a TSR getting in the way. Our MS Certified Prof. made sure
this was not the problem.
- Our global data segment or module level global data segment is getting
tight due to the number of user defined types and variables of those types.
This we think could be a candidate. Is there a tool out there that can help
us figure this out? We can do the manual method of counting bytes, but I
don't think we're up to the task right now.
- We've got too many bas files. This we're alleviating by folding some bas
files into one. However, this could lead to a module level global data
segment going beyond 64K.

The tool VB Compress Pro gave the following statistics on our project:
   ITEM BY TYPE                  REFERENCED          NOT REFERENCED      
   ============================  ==================  ==================  
   Global Constants                 429/474   91%            45    9%
   Global Variables                   17/18   94%             1    6%
   Global Types                     101/112   90%            11   10%
   Global API/DLL Procs               30/33   91%             3    9%
   Module Constants                926/1568   59%           642   41%
   Module Variables                 248/276   90%            28   10%
   Module Procs                     762/920   83%           158   17%
   Form Constants                   497/566   88%            69   12%
   Form Variables                     84/89   94%             5    6%
   Form     Procs                 1225/1227  100%             2    0%
   Local Constants                  146/147   99%             1    1%
   Local Variables                4129/4240   97%           111    3%
   Implicit Local Vars?                 956                 n/a
   String Literals                      845                 n/a
   Numeric Literals                    1088                 n/a
   Arguments                      2288/2339   98%            51    2%
   Labels                           474/476  100%             2    0%
   ============================  ==================  ==================  

Again, we're planning on cleaning up the dead code. After doing all that
cleanup though, I still don't think we can include all of the files required
by the project.

One other interesting sidenote. Below is a diagram of the project directory

With this configuration, adding one file to the project results in the
insufficient variable space error. However moving the 'PC' subdirectory to
the same level as 'DEVEL' so that it now looks like the following:

results in a successful compile. But again, adding another file results in
the same old error. Weird eh?

My questions are:
- Has anyone out there run across this problem before? Please tell me at
least one person out there has seen this. :-)
- Have we really hit the limits of VB? In looking at MS document Q112860, it
certainly does not sound like it.
- Faced with the possibility of splitting the application into 2 executables
or turning some of the functionality into DLLs, which is the better
- What have others done with large VB projects?

Any help would be greatly appreciated.

Rory M. dela Paz                     | "In the time of chimpanzees

(617) 374-8521                       |   - Beck

Mon, 04 Aug 1997 03:07:54 GMT  
 [ 1 post ] 

 Relevant Pages 

1. out of memory - insufficient variable space vb 3.0

2. Help - Insufficient Variable Space

3. Out of Memory - Insufficient variable space

4. Out of Memory - Insufficient variable space

5. Out of memory - insufficient variable space

6. Space Space Space Space Space Space Space

7. Space Space Space Space Space Space Space

8. Space Space Space Space Space Space Space

9. Insufficient Stack Space

10. Error 28 : Insufficient Space Stack

11. insufficient space in the emulator???

12. Need VERY large numeric variables (maybe as large as 1MB)


Powered by phpBB® Forum Software