Link to home
Start Free TrialLog in
Avatar of jayLi
jayLi

asked on

Memory shortage problem with VB 5.0. Help! Help!!

Hi, All:

I am having a serious problem with VB 5.0, please help!

There are one SSTab control that contains 10 tabs, and 3 dialog boxes in my project.
The SSTab and 3 dialog boxes contain total approximately over 800 controls that are put in various arrays of controls (text box, combo box,check box, list box, command button, option button).  Also, the project contains 5 file
modules.

when this project is opened, I got a message says "Out of Memory". I couldn't run it and do anything on it.

In my computer, the RAM' capacity is 84 MB. I checked resource meter in system tools (Windows98). Before opening the project, System free memory is 85%, User free memory is 85%, and GDI is 86%. However, as soon as my project is opened and the forms are loaded, the System free memory is only 7%, User free memory is 7% and GDI free memory is 85%. A warning message shows ou and says that " more than 90% of resources has been using and the project should be terminated.  It is not enough to support rest of my work on the project.

I believe there must be some ways to avoid such situation, but I have no idea about it.

Could anybody give me a hint to solve this problem?

Thank you in advance!

Jay
ASKER CERTIFIED SOLUTION
Avatar of waty
waty
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mark2150
mark2150

You need to partition that puppy up into several forms and only load them as required in memory. If you start with a module level call you can throw your forms on the screen one at a time and unload them when done.

I'd hate to see what your screens look like!

Your SSTAB control is wayyyyyyy overloaded. Perhaps you can restructure your code to be a little more elegant with it's use of controls? Maybe reuse some of them? Certainly you're not putting 800 controls on the screen at *once*? (If you *ARE*, then there is definately room for improvement!)

Use combo and list boxes instead of lines of text boxes, etc. Can't say too much more without seeing the structure, but there surely is a way to cut down on the clutter.

M

Avatar of jayLi

ASKER

Thank you for your help.

I think what Mark2150 said is more useful for solving my problem.

What I would like to know  after getting both your answer is that IS THERE ANY way to reduce memory consuming.

Mark2150 suggested reducing number of controls. That's a good idea. If I MUST have so many controls in my one form, is there a way to increase memory setting (in Windows95/98, or VB environment) for my project?

Thank you again.

JAY