Главная страница | назад

Article #15662: Possible causes for insufficient memory

 Question and Answer Database

FAQ662C.txt   Possible causes for insufficient memory
Category   :IDE
Platform    :Windows 3.1
Product    :   BC++4.5x   TC++Dos3.0   TC++Win4.5


Sometimes, when bcw is running, I cannot run any other 
program (I use Windows 3.11). It does not depend what size it is.
The following message appears:
Insufficient memory to run this application. 
I quit one or more Windows applications and then try again.
As I close only one little program, such like notepad, I can 
run an other one. I can run also a bigger one than notepad.

When the message appears, I still have 49% of User Resources, 
42% of GDI Resources and still enough of RAM (my computer has 16
MB RAM and 30 MB of virtual memory). Our program has 31 DLLs and 
the totally size of the program is 8.35 MB.

Why does this message appear? What are the possible reasons? How 
can I find the bug? What can I do?


There are several ways that you could have run out of things 
even 'though there is plenty of raw memory. Run out of any of 
these things and you will not be able to start another task. 

Each application has a database entry in the memory below the 
physical 1 Meg address. If the entries eat too far into that 
area you will not be able to start another program. 

Windows 3.1 only provides heap for about 200 windows classes. 
When that fills up, you are stalled.

Windows has a limited heap for GDI resources, bitmaps, cursors, 
icons, and the like. Again, when it's full, you're stalled.

Only 5 device contexts can be active. Once that happens, nothing 
works until one is freed.

There surely are a lot more items than these in Win 3.1 that can 
keep you from running and I'm sure I don't know them all, but 
these seem to be the most common ones. 

7/2/98 10:32:32 AM

Last Modified: 01-SEP-99