What is the Best Memory Debugger? 4
laci asks: "I'm sure many of you have used memory debuggers in the past. I have used Purify before, but now I need a memory debugger for Linux and/or AIX. My main concern is that the application I'm working on does a HUGE number of memory allocations (100s of millions). A constant factor slowdown is acceptable (even if it's a factor of 10), but the debugger should not slow down to a crawl. Also, I'd like to know which memory debuggers work on both platforms (I know of insure++ only)."
Ask Timothy Leary (Score:1)
LSD, from what I've heard.
List of memory debugging tools (Score:2)
Fortify (Score:1)
It is free and includes source code, but does not have an open source license.
Electric Fence and YAMD (Score:1)
I use a combination of Electric Fence [freshmeat.net] and YAMD [freshmeat.net].
Electric Fence is portable (including to AIX), and it detects overruns very nicely. It requires that libefence be linked with the program.
YAMD detects overruns too, but it also tracks allocations and deallocations, finds leaks, and produces a superb report about what memory was allocated and where. It seems to be very reliable, and doesn't need the program to be rebuilt. AFAIK it works only on Linux.
Both of these systems will slow your program down, especially if you do a lot of allocations. Fortunately tools like these help you to find the bugs before the symptoms appear (especially if you use the reports generated by YAMD) so you can often run with smaller data sets, or write code to test parts of your application in isolation.
Good Luck,
Molly.