All pastes #801876 Raw Edit

Miscellany

public text v1 · immutable
#801876 ·published 2007-11-29 17:52 UTC
rendered paste body
Top is not to be trusted. 

Again, the only way to get at real memory usage is by watching the
contents of /proc/<Process ID>/smaps.  It is a new addition to the Linux
kernel for watching REAL memory usage statistics for user space
programs.  That is what I have been doing to chart the growth in heap.
Unfortunately I don't have my tool completed, use I deleted my hard
drive on Thursday and spend the weekend recovering it.  So I will start
working the monitor program again soon.

What you say is totally true about Top not seeing memory getting
de-allocated.  That is why monitoring heap size in smaps for the process
ID under investigation is better.  What cannot be said is that heap will
shrink with each de-allocation.  But what can be said is that when most
of the memory has been used up, but our program has freed the memory,
heap will shrink, due to the system looking for memory to allocate
causing de-allocated segments to be reallocated.  I have run this test,
and it seems the system just runs out of memory and never reuses memory,
which means some de-allocation is not happening.  Could you put a printf
statement in the code where you call your free statement?  Would I call
that your destructor method?