What is the best free memory leak detector for a C/C++ program and its plug-in DLLs?

C++CVisual StudioMemory Leaks

C++ Problem Overview


I have a .exe and many plug-in .dll modules that the .exe loads. (I have source for both.) A cross-platform (with source) solution would be ideal, but the platform can be narrowed to WinXP and Visual Studio (7.1/2003 in my case).

The built-in VS leak detector only gives the line where new/malloc was called from, but I have a wrapper for allocations, so a full symbolic stack trace would be best.

The detector would also be able to detect for a leak in both the .exe and its accompanying plug-in .dll modules.

C++ Solutions


Solution 1 - C++

I personally use Visual Leak Detector, though it can cause large delays when large blocks are leaked (it displays the contents of the entire leaked block).

Solution 2 - C++

If you don't want to recompile (as Visual Leak Detector requires) I would recommend WinDbg, which is both powerful and fast (though it's not as easy to use as one could desire).

On the other hand, if you don't want to mess with WinDbg, you can take a look at UMDH, which is also developed by Microsoft and it's easier to learn.

Take a look at these links in order to learn more about WinDbg, memory leaks and memory management in general:

Solution 3 - C++

I have had good experiences with http://www.ibm.com/software/awdtools/purify/">Rational Purify. I have also heard nice things about http://valgrind.org/">Valgrind</a<;.

Solution 4 - C++

As for me I use Deleaker to locate leaks. I am pleased.

Solution 5 - C++

My freely available memory profiler MemPro allows you to compare 2 snapshots and gives stack traces for all of the allocations.

Solution 6 - C++

Try Jochen Kalmbach's Memory Leak Detector on Code Project. The URL to the latest version was somewhere in the comments when I last checked.

Solution 7 - C++

As several of my friend has posted there are many free leak detectors for C++. All of that will cause overhead when running your code, approximatly 20% slower. I preffer Visual Leak Detector for Visual C++ 2008/2010/2012 , you can download the source code from - enter link description here .

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJim BuckView Question on Stackoverflow
Solution 1 - C++ZoobaView Answer on Stackoverflow
Solution 2 - C++davidagView Answer on Stackoverflow
Solution 3 - C++Anders SandvigView Answer on Stackoverflow
Solution 4 - C++MastAvalonsView Answer on Stackoverflow
Solution 5 - C++Stewart LynchView Answer on Stackoverflow
Solution 6 - C++Agnel KurianView Answer on Stackoverflow
Solution 7 - C++IdanudaView Answer on Stackoverflow