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

my application will print several lines, for example:

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 come from? Does this mean that my application has some errors or a memory leak? How can I trace the root cause?

+6
source share
2 answers

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

Depending on your application, a large selection may or may not be a mistake.

In any case, the part after the @ sign is a stack trace and can be used to find the source of the message.

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

+7
source

If you are still running the process or you can dump it ( kill -ABRT ), you should be able to connect 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 a reliable mistake.

+1
source

Source: https://habr.com/ru/post/907297/


All Articles