?
Solved

Out of memory

Posted on 2011-10-24
8
Medium Priority
?
231 Views
Last Modified: 2012-05-12
Hi,

I have a visual C++ app that sometimes (very rare) it creates an error (Message Box) "Out of memory". It seems that it happens only in release version and not when I am using the debug version.
Also, It is not because a memory lost - I checked the memory of the app when the Message-Box is on and there is no problem, so I think it is because a Page Fault.
How can I debug it???
0
Comment
Question by:VapiSoft
  • 4
  • 4
8 Comments
 
LVL 2

Expert Comment

by:greg-hawkins
ID: 37017951
Hi,

I'd say it may well be page file, what I would do first is make the page file bigger... Whats your O/S?
0
 

Author Comment

by:VapiSoft
ID: 37017979
I am using VISTA.
Why do you say that it is a page-file problem?
How can I create a page-file problem?
0
 
LVL 2

Expert Comment

by:greg-hawkins
ID: 37018029
A page-file is a file on the local disk which acts like slow RAM. this is where big programs will store data for slightly faster access. (normally databases etc).

If you would like to check on the size of your page file you need to, right click on "computer" then "properties" - "advanced system properties" then "advanced" tab.

'performance - settings', then 'advanced' tab once more. It will then say how much your 'Virtual Memory' is, this should be close to how much RAM is in your machine.
0
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

 

Author Comment

by:VapiSoft
ID: 37018052
It is 2088 MB
I don't understand why you think it is bacuase of that, and I don't see how I can affect it in my code.
I think that the problem is "Page Fault"

0
 
LVL 2

Expert Comment

by:greg-hawkins
ID: 37018077
When you complile your code it takes up a large amount of memory and also CPU. I thought it maybe down to either RAM or Pagefile not being high enough to process and store all of the information, therefore giving an 'out of memory'.

Maybe? (I could have gotten the complete wrong end of the stick).
0
 

Accepted Solution

by:
VapiSoft earned 0 total points
ID: 37018562
I found and fixed the problem.
It was something wrong in my code that was not detected by the debugger.

The importance is that I found it only when I compiled the release with debug info,
and in the exceptions I added all the Win32 exceptions that handles memory problems.
So it "breaked" on the memory problem (instead of creating the MessageBox).
0
 
LVL 2

Expert Comment

by:greg-hawkins
ID: 37018572
Ah right.

Well; good one, and sorry I led you on a wild goose chase. :)
0
 

Author Closing Comment

by:VapiSoft
ID: 37049208
I think it has an importance for other people how to debug it.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

612 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