Alternative to valgrind (memcheck) for finding leaks on linux? [closed] Alternative to valgrind (memcheck) for finding leaks on linux? [closed] linux linux

Alternative to valgrind (memcheck) for finding leaks on linux? [closed]


Give Dr. Memory a try. It is based on DynamoRIO and shares many of the features with Valgrind.


The TotalView debugger (or, more precisely, its Memscope) has a feature set similar to the one of Valgrind.

You can also try Electric Fence (original author's link) (the origin of DUMA) for buffer overflows or touch-after-free cases (but not for memleaks, though).


In 2020, to find memory leaks on Linux, you may try:

Address Sanitizers

For both GCC(above 4.8) and Clang (above 3.1), the address sanitizer can be used, it's greatthe tool has been proved useful in large projects such as Chromium and Firefox.

ASan will provide very detailed memory region information, which is very helpful for analysis of the leak.

The drawback for ASan: You need to build your program with the option -fsanitize=address

TCmalloc

TCmalloc can be both used with LD_PRELOAD or directly link to your program. The result can be visualized with the pprof program, it has both beautiful web UI and consoles text mode, I suggest using it if address sanitizer is not applicable in your environment(If you have a very old compiler or your PC have very limited memory to run ASan).enter image description here