|
From: Nicholas N. <n.n...@gm...> - 2010-09-14 07:04:32
|
On Mon, Sep 13, 2010 at 1:44 PM, Philippe Waroquiers <phi...@sk...> wrote: > While implementing a patch to fix quadratic memory usage in m_mallocfree.c > (see http://bugs.kde.org/show_bug.cgi?id=250101) > I encountered some questions related to the high memory usage by memcheck: > > First question: memcheck client redzone: > ----------------------------------------- > Memcheck sets a client redzone (16 bytes IIRC). This is significant for small allocations. > What is the purpose of this memcheck client redzone ? > (as reading or writing before or after a malloc-ed block will be trapped by the rest > of memcheck machinery). If you overrun by a very small amount, you'll get a warning. If you overrun by a slightly larger amount, you may well end up accessing another heap block, which won't cause a warning. Having a 16 byte redzone means that more of these small overruns will be caught. > Second question: why multiple arenas ? > ---------------------------------------- > What is the reason to "split" the allocation between client arena and the other (non client) arenas ? > When using only one non-client arena, the memory usage by valgrind of a big process > decreased of 8%. > > Has this split "functional" advantages ? > Or performance advantages for some cases ? I think the different arenas have different superblock sizes. Maybe it's not a good idea, though. Nick |