Runtime error 7 out of memory - what memory are we talking about? (1 Viewer)

amorosik

Member
Local time
Today, 07:48
Joined
Apr 18, 2020
Messages
395
Some times it can happen, especially with loops out of control, that Access returns the terrible error 7
Exactly what memory are we talking about?
Even if this error is not reported, how can we monitor the 'memory' still available for our Access program?
 

isladogs

MVP / VIP
Local time
Today, 06:48
Joined
Jan 14, 2017
Messages
18,246
Some times it can happen, especially with loops out of control, that Access returns the terrible error 7
Exactly what memory are we talking about?
Even if this error is not reported, how can we monitor the 'memory' still available for our Access program?

 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 06:48
Joined
Sep 12, 2006
Messages
15,660
I would think that most likely your process is undergoing recursion, repeatedly calling itself without end, and ends up running out of memory.

recursion pushes variables on to the stack to start the next iteration. When the iteration completes, it removes the pushed variables from the stack. If you write the process wrongly, the recursion never completes, the stack gets full, and you run out of memory.

You need to look at your process carefully, so that any recursive loop terminates correctly.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:48
Joined
Feb 28, 2001
Messages
27,217
Even if this error is not reported, how can we monitor the 'memory' still available for our Access program?

If there is room on your screen for it, open Task Manager and switch to the "Processes" tab. Launch and then find your process, which will probably be MSACCESS.EXE (and may have a secondary file open in some rare cases as indicated by a ">" symbol on the left). Click on the process line and then look at the amount of memory it is using. You should be able to watch it grow.

As to things that "eat" memory, Dave's suggestion of recursion, whether intentional or not, is a really quick and easy way to go crazy with memory. However, a couple of more "oldies but goodies" would be (a) repeated re-DIM of an array to a larger number of entries (b) repeatedly calling any sub in which you have some really large arrays (c) copying a MEMO/LONG TEXT string several times (d) using OLE embedding of large documents.
 

Users who are viewing this thread

Top Bottom