From: "Edmund Horner" Newsgroups: comp.os.msdos.djgpp 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> <969134119 DOT 601345 AT osiris DOT esoterica DOT pt> Subject: Re: free() DOESN'T return memory to system Lines: 73 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Organization: Paradise Net Message-ID: <969160563.517979@shelley.paradise.net.nz> Cache-Post-Path: shelley.paradise.net.nz!unknown AT 203-96-146-118 DOT tnt2 DOT paradise DOT net DOT nz X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: Sun, 17 Sep 2000 15:13:29 +1200 NNTP-Posting-Host: 203.96.152.26 X-Complaints-To: newsadmin AT xtra DOT co DOT nz X-Trace: news.xtra.co.nz 969160564 203.96.152.26 (Sun, 17 Sep 2000 15:16:04 NZST) NNTP-Posting-Date: Sun, 17 Sep 2000 15:16:04 NZST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Yep, you have a point there. But remember that DPMI, let alone DJGPP, was not designed with Windows in mind. You can try to fix it, but you may find it tricky... wrote in message news:969134119 DOT 601345 AT osiris DOT esoterica DOT pt... > 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 > >> > > > >