|
From: Nicholas N. <nj...@cs...> - 2008-05-17 00:29:43
|
On Fri, 16 May 2008, jlh wrote: > Thanks, I had a look at electric fence and it's not about memory leaks, but > rather about buffer overruns. But there's a fork of efence called DUMA which > intercepts calls to memory functions to trace down memory leaks. But it's mode > of operation is to segfault whenever something bad is detected; it's meant to > be run in a debugger, so you can immediately have a look at what happened. I > prefer the way valgrind works: It collects all information but doesn't > interrupt anything; then at the end you get a long report. > > Also, I somehow managed to overlook the most obvious candidate for finding > memory leaks: mtrace. It's actually part of glibc and already was on my > system. It still slows down the program quite a bit (DUMA did as well), but > much less than valgrind, since only the memory function calls get slower, but > the rest runs at native speed. It seem to be a great tool for C, but doesn't > do well with C++. :( I think there are 1001 malloc-replacement libraries that provide some level of checking. IIRC the mpatrol manual (http://www.cbmamiga.demon.co.uk/mpatrol/) has an extensive list of them. Nick |