Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming IT Technology

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)."
This discussion has been archived. No new comments can be posted.

What is the Best Memory Debugger?

Comments Filter:
  • What is the Best Memory Debugger?

    LSD, from what I've heard.

  • Ben Zorn maintains a list [colorado.edu] of memory debugging tools (both for detecting access violations (like Electric Fence) and for detecting memory leaks).
  • I have found Fortify [geocities.com] to be a very helpful memory debugger. It supports both new/delete and malloc/free memory management. It traps memory leaks, writes beyond and before memory blocks, writes to freed memory, free twice, freeing memory never allocated, amongst others. It's performance hit is certainly noticeable, but should scale well under heavy use. I have only ever used it on one platform, but it claims to be very portable.

    It is free and includes source code, but does not have an open source license.

  • 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.

"It's the best thing since professional golfers on 'ludes." -- Rick Obidiah

Working...