Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free some memory

Status
Not open for further replies.

WilsonM

Programmer
Feb 5, 2001
22
CA
Hi guys,

I'm having some memory problems and it's not because I don't have enough RAM (I have 256 MB of RAM).

Could anyone tell me if there is a way to release the memory or a function that would do the same. I already close my objects and set them to nothing after using them.

ex.: recordset.close
Set recordset = nothing

Could some one please help me, thanks in advance.

Wilson
 
I have had to download an exe called Max Ram because I was having memory problems developing with VB Access and Excel open (and TekTips) This became annoying when you didnt have enough memory to save after a couple hours work .. So far it works ok and at least when I run into memory issues it does free up enough for me to save safely.


I can give you some urls if you are interested.

Joanne
 
Hi Joanne,

Thanks for the quick response and yes I would love to take a look at those urls.

Thanks again,
Wilson
 
Here some information about the memory problem (from the ACCESS ONLINE ENCYCLOPEDIA at
Article Code: G3

Why insufficient memory ?
Description


You can have installed lots of RAM (128 MB and more) on your machine but nethertheless ACCESS crashed after a short period of time indicating that you do not have enough memory to display something. This problem is very frequent during the development phase as you often have to change into design view of forms, reports and modules.
In general you need to reboot your computer to be able to continue. Upgrading your RAM to 256 MB (and more) does not help.
If you check the "Free ressources" window (Windows System or ACCESS Information window) you see between 5 % and 50 % .
Sometimes you will see a system alert with "Memory Running Low" before the crash.
This crash happens on different computers at different times: On Computer 1 ACCESS will crash as soon as the ressources drop under 50%, whereas Computer B will work with less than 10%.

Explanation Part 1


The RAM is divided in different areas that hold different system information. In the so-called GDI-HEAP information about the open windows are stored (Position, Status, Size, Handle...) The size of the GDI-HEAP is limited to 64kB - independantly from the total RAM installed on your machine. Once the GDI-HEAP is saturated the system (or certain programs) will crash.

Explanation Part 2

As soon as you close a window, the occupied area in the GDI-HEAP should be released. Unfortunately, this does not work properly with ACCESS neither on closing a single database object (Form, Report, Module...) nor on closing ACCESS.
Explanation Part 3


As soon as you ope any VBA module (globales or Form/Report class module) all modules of the application are opened, each in a single window. In any medium sized application it can easily happen that 100 windows are opened instantly. This moment leads quite often to a crash because the GDI HEAP is saturated.
Solutions

There are several workarounds, you should opt for a combination:
Limit the number of forms, reports and modules.
Delete all unused database objects
Limit the number of background graphics and tab controls
Distribute your database objects on different libraries
Recreate your database file regularly and import the objects
Activate the VB password and only one module window will be opened at a time
(ATTENTION: removing the VB password again might become difficult).
Do not close forms that you permanently need but
 
Thanks for the help ... you guys are great.

Wilson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top