alloca, malloc and friends

RANDY S WELCH rwelch at diana.cair.du.edu
Fri Oct 26 15:25:28 AEST 1990


In article <6793 at suns302.cel.co.uk> ir at cel.co.uk (ian reid) writes:

   The problem is that there is no way that this memory can be returned to
   the operating system, at least no way documented on the sbrk(2) manual
   page which is where I would expect to find it, after all free(3) is
   documented on the malloc page.  free simply returns the memory to the
   pool managed by malloc not to the operating system, the documented
   behaviour.

   Well imagine this, an application mallocs (insert a number here which
   is a large amount of memory for system), this is a one-off occurrence
   and this much memory is never needed again.  But the application size
   can never shrink, therefore a lot of memory which is not being used is
   unavailable to the system.


   Ian Reid 					#include <std/disclaimer.h>
   UUCP: ir at cel.uucp or ir at cel.co.uk or    ...!{ukc,mcsun,uunet}!cel!ir
   "Computers..proof positive that no-one yet understands how to describe any real
    world situation in 0's and 1's."

You might want take a look at the malloc that is on prep.ai.mit.edu.  It
is capable of returning memory back to the system.  And it does seem to
work.  I am currently using as the malloc when compiling GNU Emacs.  And
it seems to work rather well.  Worth looking at.

-randy
-- 
Randy Welch   Mail to :  ...!ncar!scicom!bldr!randy or rwelch at du.edu
Boulder, CO   VOICE   :  303-442-6717
"Unfortunately, life contains an unavoidable element of unpredictability"
-David Lynch "The Angriest Dog in the World"



More information about the Comp.unix.questions mailing list