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

19.2k views Asked by At

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?

2

There are 2 answers

1
Ofir On BEST ANSWER

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.

0
bobah On

If you still have the process running or were able to core dump it (kill -ABRT) then you should be able to attach gdb and run the info symbol <address> command (<address> is one of those hexadecimal numbers after @ in the error message: 0x727432 ...).

In my case it was an authentic error.