Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Out of memory error 7, a discussion

Posted on 1998-11-12
Medium Priority
Last Modified: 2012-06-27
Out of memory error 7

Ladies and Gentlemen,

I seek your information concerning my application that
at odd times falls into a "Out of Memory Error 7"

As with any product that you are about to put out on
the market, as a professional developer, you want to make
sure that your application is idiot proof.

Since the world keeps on making better idiots,
I feel the need to constantly revise and better my code.

I can not tell you how disappointed I am when I fall upon
a "Out of Memory Error 7". My application can run fine for
hours and then fall upon one of these.
Never during the same action or at the same place.

I ask you, to please share your comments or knowledge
concerning this issue. I am overwhelmed, and have no idea
what to do.

Thank you.
Question by:vienna
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2

Accepted Solution

vikiing earned 0 total points
ID: 1444646
Error 7 appears when more memory was required than is available, or a 64K segment boundary was encountered. Based on Microstuff comments, this error is due to some of these reasons. Take a look at possible solutions:

You have too many applications, documents, or source files open.

Close any unnecessary applications, documents, or source files that are open.

You have a module or procedure that is too large.

Break extremely large modules or procedures into smaller ones.  This doesn't save memory, but it can prevent hitting 64K segment boundaries.

You are running Microsoft Windows in standard mode.

Restart Microsoft Windows in enhanced mode.

You are running Microsoft Windows in enhanced mode, but have run out of virtual memory.

Increase virtual memory by freeing some disk space, or at least ensure that some space is available.

You have terminate-and-stay-resident programs running.

Eliminate terminate-and-stay-resident programs.

You have many device drivers loaded.

Eliminate unnecessary device drivers.

You have run out of space for Public variables.

Reduce the number of Public variables.


Expert Comment

ID: 1444647
You have run out of space for Public variables???

Just how much are we allowed?


Expert Comment

ID: 1444648
It seems like more of an operating system defect under Windows95 because my application is only getting error 7's under 95 and never under NT.  There is a large Public variable and a form module which if just over 100k but this is absurd to expect that a single large PV will cause errors only under Windows 95?  (using vb5 w/sp3 here).  There is no way to keep some form modules under 64k when you need treeview and wang imgedit controls on them you are starting out at 64k before you start writing code!

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Expert Comment

ID: 1444649
would you mind working with me on this matter?
Hopefully, we can better our products in this process by sharing our findings.

Give me your email address.


Expert Comment

ID: 1444650
Vienna,  any application which does not error right at startup (as with mine) but does so later on is experiencing some sort of memory leak.  

Watch your use of exit sub and exit function calls etc. Replace those with goto bottom and put bottom: at the very end of the function so it will reach the actual natural END FUNCTION statement to return.  Also try to limit your jumps out of the middle of loops and try not to nest your FORS and IF's too deeply.  

Obviously be very careful of recursion and make certain it actually returns on recursive calls to the original first calling layer. (although those tend to eat up the stack before the memory)


Expert Comment

ID: 1444651
Just a question, Rayford: ¿why you suggest a GOTO BOTTOM (with BOTTOM label pointing to END FUNCTION/SUB?; EXIT FUNCTION/SUB does exactly the same (it generates a RET machine-instruction, as EXIT SUB does).

Besides that, ¿what's the intended purpose of EXIT SUB if it doesn't work properly?; perhaps VB has a bug involving that, but just think of this: if there were any thing remaining at stack (where return addresses are stored), because EXIT SUB works different from END SUB, then the program will surely die almost immediately each time control returns from a SUB with EXIT. ¿Have you experienced something like that?


Expert Comment

ID: 1444652
How many Public variables are we allowed?


Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question