Help on malloc library
Sreenivas Reddy
sreddy at oracle.UUCP
Wed Jul 18 16:42:03 AEST 1990
Normally when a pointer is 'free'ed in unix, free function appends the memory
associated with the pointer to its internal free list and it doesn't return
it to the operating system. Thus the heap of a process at any given time
could be much more than what it is actually using during it's lifetime. Also
note that process heap size would never decrease during it's lifetime. This
could lead to bad performance due to unnecessary swapping if there are lot of
users (running the same application that uses lot of heap).
If there is a free block at the top of the process heap, it can be released to
the OS (with sbrk(-size)). Free function can be modified to accomplish this, but
it would require different implementation of malloc library. Are there any good
algorithms to do this? Has anyone attempted this before?
Thanx,
Reddy
More information about the Comp.unix
mailing list