Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: memory leak?



Guido Fiala writes:

 >result with new/delete quite the same. However - only with random 
sizes! If
 >you allocate always the same size the process shrinks at his previous 
vmsize
 >value exactly (but a few kb rss more).
 >
 >What does that tell us?
 >
malloc() uses sbrk() which gets VM from the kernel when necessary. That
VM is never released during the process life.
That's why free(malloc(100000000)) will increase the allocated VM, but
keep RSS small.

For big memory chunks, best would be to use mmap()/munmap() (if
supported on linux).

/Régis






Home | Main Index | Thread Index