This is, methinks, a libc problem...malloc() will (when necessary) aquire
a heap of memory w/ a system call, then allocate segments within that
heap; free() marks those sections of the heap "de-allocated", but does not
return it to the OS until the program exits.
There are potential performance hits if free() automatically does a
"hard-release" (correct me if I'm wrong), particularly for
string-intensive and similar applications that are constantly allocating
and freeing substantial amounts of memory.
> - Is there anyway, in which I can force my process to return the
> memory to the operating system, in such a way that Linux can
> recycle this memory ? ( I only need it when starting my process,
> after init I can throw it out).
mallopt() provides a mechanism for "tuning" the behavior of the malloc
function set...of course, my DU4.0 man pages say "it's no longer supported
by us, don't use it", and I can't hit any Linux man pages from here :-P
Adam
-- He feeds on ashes; a deluded mind has led him Adam Bradley, UNCA Senior astray, and he cannot deliver himself or say, Computer Science "Is there not a lie in my right hand?" Isaiah 44:20 bradley@cs.unca.edu http://www.cs.unca.edu/~bradley <><