c++memory-managementtcmalloc

How to trace "tcmalloc : large alloc .... "


my app print several line like:

tcmalloc: large alloc 4294488064 bytes == 0x2b968d8000 @  0x727432 0x727302 0x727a58    0x75a07d 0x574beb 0x585756 0x5575df 0x5717db 0x57108f 0x58078c 0x302b80610a
tcmalloc: large alloc 4294488064 bytes == 0x2c97063000 @  0x727432 0x727302 0x727a58   0x75a07d 0x574beb 0x585756 0x5575df 0x5717db 0x57108f 0x58078c 0x302b80610a
tcmalloc: large alloc 4294488064 bytes == 0x2b968d8000 @  0x727432 0x727302 0x727a58 0x75a07d 0x574beb 0x585756 0x5575df 0x5717db 0x57108f 0x58078c 0x302b80610a

where does this message comes from? does it means my app has some bugs or memory-leak? how can I trace the root cause?


Solution

  • See http://code.google.com/p/gperftools/source/browse/trunk/src/tcmalloc.cc?r=80&redir=1 line 843

    Depending on your application - the large allocation may or may not be a bug.

    In any case - the part after the @ mark is a stack trace and can be used to locate the source of the message

    The repeating number (4294488064 which seems to be equal to 4G-479232 or 0x100000000-0x75000) makes me suspect the original allocation call got a negative signed value and used it as an unsigned value.