Out Of Memory Error 7 at 200Mb
Hi,
I have an app that loads a large number of bmps into memory on load.
Using the task manager I can see it loading them into memory. However when it goes a little over 200Mb it goes to debug with "Error 7 Out Of Memory".
I'm running XP 32bit with 4Gb of RAM. I know that VB6 has a limit of 1.8Gb with this spec, but why on earth am I out of memory at 200Mb.
many thanks
Paul
Re: Out Of Memory Error 7 at 200Mb
Why an error occurs depends on your code/data, and which line of code the error is occurring on. To find out the cause you need to debug it, as explained in Marty's debugging tutorial.
There is a good chance that in this case the error is due to a particular picture file being too large (in terms of the picture width/height etc, not the file size).
Re: Out Of Memory Error 7 at 200Mb
Paul
Here is a recent thread on a similar issue
http://www.vbforums.com/showthread.php?t=618399
Not sure how/if it was resolved, but it may be helpful
Spoo
Re: Out Of Memory Error 7 at 200Mb
Re: VB6 Image and Picture Controls Out of Memory Error 7
I had an experience one month ago. on my XP/521MB,I want to use GDI+ to open some tiff file which are converted from AutoCAD file. Some can open even though I have to wait for few minutes,some can't.
1) GDI+ GdipDrawImageRectRectI API did check the file dimension before rendering. If my tiff file is too huge,GdipDrawImageRectRectI will quit immediately.
2). If that dimension can be handled by GdipDrawImageRectRectI API,GdipDrawImageRectRectI will take few minutes to render. It is system variation,depend on your hardware.
e.g. a tiff file dimension is 14400x9600pixels,Bits Per Sample is 1,Compression is CCITT Group 4 Fax,Resolution for x and y is 400 DPI.
Quote:
<FAILED even on Win7 with Dual core/4G memory>
GdipDrawImageRectRectI graphics, Image, 0, 0, Width , Height , 0, 0, Width, Height, UnitPixel, 0, 0, 0
Quote:
<FAILED>
GdipDrawImageRectRectI graphics, Image, 0, 0, Width / 1.4064, Height / 1.4064, 0, 0, Width, Height, UnitPixel, 0, 0, 0
Quote:
<OK,but took 3 minutes>
GdipDrawImageRectRectI graphics, Image, 0, 0, Width / 1.4065, Height / 1.4065, 0, 0, Width, Height, UnitPixel, 0, 0, 0
Re: Out Of Memory Error 7 at 200Mb
I am also using the GDI wrapper and loading my images with:
GdipLoadImageFromFile File, img(i)
Still not found why task manager is showing only 200Mb. However.... I did a simple test of looking at the size of the graphics folder and it is around the 1.8Gb mark. So the reason it is running out of memory is because it is loading too many graphics, but this still doesn't explain why task manager is showing 200mB not 1.8Gb
Re: Out Of Memory Error 7 at 200Mb
It isn't loading all of the files, it is getting an error long before that - which is very likely to be due to particular file(s), but could be something else.
If you don't investigate why it is happening (using debugging etc), you will not be able to find the cause, and therefore will not be able to work out how to solve it.