tags:

views:

117

answers:

3

Hi,

What are some of the good tools for analysing memory (for footprint, allocation and deallocation)? I am familiar with valgrind. If there are tools apart from that, would be nice to know about them.

Best.

+1  A: 

IBM has Rational Purify for both Windows and Linux. I haven't used it, as it's rather costly, but there is a free trial available.

Darel
I used it about a decade ago, and thought it very nice.
David Thornley
I used it also about a decade ago, until it was bought by IBM, no new versions were announced anymore, and it started to crash because my application became too big. Since then, no more.
Patrick
+1  A: 

If you're talking about valgrind I suppose that you are interested in Linux software.

You can easily build your custom report for footprint allocation and deallocation by using MTrace. It is not directly C++ but directly integrated into the GlibC. As far as I know C++ new and delete operators use this to allocate the memory before calling the constructor and deallocate memory after calling the destructor.

jdehaan
+1  A: 

The nice thing about mcheck is that you automatically have it whenever you you glibc. Set the environment variable MALLOC_CHECK_ to 1, and diagnostic is printed on stderr every time heap inconsistency is detected; if set to 2, abort() 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 trace malloc in endless detail:
http://www.gnu.org/software/libc/manual/html_node/Allocation-Debugging.html

alex tingle