From: almeidaj AT mail DOT com Newsgroups: comp.os.msdos.djgpp Subject: Re: free() DOESN'T return memory to system Date: Sat, 16 Sep 2000 18:55:45 GMT Organization: Esoterica, Portugal Lines: 59 Message-ID: <969134119.601345@osiris.esoterica.pt> References: <384411007 DOT 969036196326 DOT JavaMail DOT root AT web305-mc DOT mail DOT com> <969078416 DOT 841936 AT shelley DOT paradise DOT net DOT nz> NNTP-Posting-Host: osiris-ip.esoterica.pt X-Trace: news.interpacket.net 969130660 41307 209.198.242.35 (16 Sep 2000 18:57:40 GMT) X-Complaints-To: usenet AT news DOT interpacket DOT net NNTP-Posting-Date: 16 Sep 2000 18:57:40 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 Edmund, I think you're wrong about the usefully of returning the memory to the system. Yes, 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. 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. I do know that MS Visual C, uses _heapmin() to solve this drawback. BUT i don't want to use it.... Thanks. Advise wellcome. "Edmund Horner" wrote: >Who's actually asking the question here? :) >I don't think you can explicitly return memory to the system, but then, I am >not sure it would be very useful to anyway. If you're running under DOS, >you'll only have one task happening anyway, and if you're under Win9x, the >OS will give each task as much as it needs, anyway. >But if you're really serious on this, you may be able to extend the DPMI >server and the memory functions to allow this... but I don't think it'll be >easy! >Edmund. >"J Almeida" wrote in message >news:384411007 DOT 969036196326 DOT JavaMail DOT root AT web305-mc DOT mail DOT com... >> Hi, >> >> Faq15_2.html clearly states that: "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 a way to ensure that DJGPP _does_ return memory to the system? >> Like _heapmin() in MS Visual C. >> Can someone help? >> Thanks. >> >> >> ______________________________________________ >> FREE Personalized Email at Mail.com >> Sign up at http://www.mail.com/?sr=signup >>