C ++ memory analysis

What are some of the good tools for analyzing memory (for tracking, distribution, and freeing)? I am familiar with valgrind. If there are tools other than this, it would be nice to know about them.

Best.

+4
source share
3 answers

IBM has Rational Purify for Windows and Linux. I have not used it since it is quite expensive, but there is a free trial version.

+1
source

If you are talking about valgrind, I suggest that you are interested in Linux software.

With MTrace, you can easily create your own report for posting and freeing up space. It is not directly C ++, but directly integrated into GlibC. As far as I know, new C ++ operators and operators use this to allocate memory before calling the constructor and freeing memory after calling the destructor.

+1
source

The good thing about mcheck is that you automatically get it whenever you use glibc. Set the MALLOC_CHECK_ environment variable to 1, and the diagnostics will be printed to stderr every time a heap inconsistency is detected; if set to 2, the abort () function is called immediately.

The mcheck documentation is here:
http://www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html

You can also use mtrace to track malloc in infinite details:
http://www.gnu.org/software/libc/manual/html_node/Allocation-Debugging.html

+1
source

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


All Articles