Search code examples
c++cmalloctcmalloc

C/C++ using tcmalloc


I've been trying to compile my application using tcmalloc. Therefore I append, as recommended in the usage instructions, -ltcmalloc to my compiler flags. After rerunning my application I could not see any performance differences.

How can I check if the calls to malloc have been replaced like the author of this question mentions. I had a look at the compiled assembler code but there were still calls to malloc.

Thanks in advance


Solution

  • The simplest way is to check if heap checker is working or not, by setting env HEAPCHECK, e.g. HEAPCHECK=normal

    See https://gperftools.googlecode.com/git/doc/heap_checker.html for details