Solved

Out of memory error 7, a discussion

Posted on 1998-11-12
7
464 Views
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.
0
Comment
Question by:vienna
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Accepted Solution

by:
vikiing earned 0 total points
Comment Utility
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.

0
 
LVL 4

Expert Comment

by:idcanada
Comment Utility
You have run out of space for Public variables???

Just how much are we allowed?

Concerned.
0
 
LVL 1

Expert Comment

by:rayford
Comment Utility
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!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Expert Comment

by:idcanada
Comment Utility
Rayford,
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.



0
 
LVL 1

Expert Comment

by:rayford
Comment Utility
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)

0
 
LVL 3

Expert Comment

by:vikiing
Comment Utility
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?

0
 
LVL 4

Expert Comment

by:idcanada
Comment Utility
How many Public variables are we allowed?

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now