Mail Archives: djgpp/2000/09/16/15:00:17
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" <ejrh AT paradise DOT net DOT nz> 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" <almeidaj AT mail DOT com> 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
>>
- Raw text -