Mail Archives: djgpp/1996/03/07/07:06:59
Xref: | news2.mv.net comp.os.msdos.djgpp:1706
|
From: | Goldtree <goldtree AT communique DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Running out of memory
|
Date: | Wed, 06 Mar 1996 19:42:48 -0600
|
Organization: | Communique Inc., New Orleans
|
Lines: | 25
|
Message-ID: | <313E3F18.712F@communique.net>
|
NNTP-Posting-Host: | 005.msy4.communique.net
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hello,
I have a program that uses malloc, realloc, and free many times
per second. I am constantly printing out the available physical memory
and at first it just goes down with free not raising physical memory,
and then reaches a plateau where neither malloc nor free seem to affect
physical memory. Now according to the FAQ this is normal (DJGPP returns
the memory to its internal pool of available pages so there is no change
in physical mem left over).
The problem is that occasionally I malloc a lot of memory (a few
hundred Kbytes) and then the available memory will go down again...with
free still not seeming to give it back. Even though I never use more
than 5 or so megs at a time eventually the memory (on an 8 meg machine)
will go below zero and try to start swapping. I have a bunch of
interrupts installed and haven't figured out how to lock them yet and so
my program crashes. I am pretty sure that I am freeing everything and
am not leaving any dangling pointers. So why am I running out of
memory?
Thanks!
John R. McCawley III
Cap'n Hardgeus
Hotwarez LLC
- Raw text -