Heap memory is not re-claiming.

V.Ravikumar ravikumar.vallabhu at gmail.com
Thu Oct 13 04:26:52 EDT 2011


Hello all,

I've a daemon process and I'm allocating heap memory** for big character
buffers using malloc/free.
Each can take 5MB.

Though I freed/deleted memory allocated for the buffers, the increased
memory during the allocation time is not re-claiming back.This I observed
using *top* command.

I'm sure I do not have any other memory leaks. I debugged the code line by
line and observing memory usage using *top* command.
During allocation time, *top* command showed that 30 MB increase in Virtual
& Resident memory.
Upon execution of delete/free statement on the buffers the raised memory was
not re-claimed.

On subsequent execution of the same code no extra memory was allocated even
though new/malloc statements called on the buffers.What is kernel mechanism
here. Is this due to some page cache re-mapping

If this due to page cache then the memory should always constant trough out
process life.
During long run the memory slowly increasing. This should not happen.

Could some body provide any insights into this..

Regards,
Ravi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111013/795e3c21/attachment.html 


More information about the Kernelnewbies mailing list