From: hipermar AT mail2 DOT esoterica DOT pt (Hiper M.A.R.) Newsgroups: comp.os.msdos.djgpp Subject: Repost: free() DOESN´T return memory to the system Date: Sat, 16 Sep 2000 19:02:13 GMT Organization: Esoterica, Portugal Lines: 24 Message-ID: <969134507.984557@osiris.esoterica.pt> NNTP-Posting-Host: osiris-ip.esoterica.pt X-Trace: news.interpacket.net 969131044 41307 209.198.242.35 (16 Sep 2000 19:04:04 GMT) X-Complaints-To: usenet AT news DOT interpacket DOT net NNTP-Posting-Date: 16 Sep 2000 19:04:04 GMT X-Newsreader: Forte Free Agent 1.0.82 Cache-Post-Path: osiris.esoterica.pt!unknown AT por253 DOT esoterica DOT pt X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com HI, Has it is clearly stated in Faq15_2.html: "When you call free, DJGPP library doesn't return memory to the system, it just adds it to its internal pool of free pages. So, from the point of view of the DPMI server, these pages are not "free". " My question is: Isn't there some way to return memory to system (besides quitting the program!)? About Win95, it will give as much as the program needs, BUT only until the memory and the swap file aren't EXAUSTED. If you have a program that is constantly allocatting memory, and freeing it when he no longer needs it, soon the resources are exauted, because the DPMI won't "see" they have been freed. Thus using free() has no impact, purelly a cosmetic sense. Returning the memory to the system, will free that resource and enable its use. Otherwise, deppending on how much ram the computer has, or /and how much the virtual memory size is setup in Win95, the program will faile to allocate memory, altough only a small amount of memory is actually in use. In MS Visual C, _heapmin() takes care of this. Thanks.