Visual C++ - Memory Leak Detection

让人想犯罪 __ 提交于 2019-12-17 18:10:14

问题


Any suggestions? This SO post talks about Visual Leak Detector, but I'm looking for other tools. Also, please don't recommend this.


回答1:


I've used Visual Leak Detector quite recently and it works pretty well. It's very simple to build it in (just include vld.h) and doesn't require any instrumentation. I found that I needed to write a couple of scripts though to parse the output into something more useful for my purposes (it is crying out for a decent GUI). Note the new website -- the project is being actively maintained on Codeplex -- the Codeproject link is very old.




回答2:


Try Deleaker or DevPartner, these both are good enough.

update:

C++ Memory Validator, works fine and fairly priced.




回答3:


If you can afford some money use the Intel Parallel Inspector (http://software.intel.com/en-us/intel-parallel-inspector).

It doesn't require any code modifications and provides good reports.

I had to look for good tools to do that in work and that's the best tool (by far) that I found.




回答4:


As suggested by Noah Roberts, i too felt Memory validator as the best tool for detecting leaks in Visual studio.

Purify also works.




回答5:


Asked a similar question not long ago but related to 2010 specifically: VS2010 profiler/leak detection

If you're not using 2010 you might consider AQtime. It's not too terrible most the time. There are times thought when it fails to find an object related to the leak and just says "crt memory" or whatever.

Another I recently tried is called "Memory Validator". Not exactly a nice interface but it does seem to work, and work with 2010 too (just doesn't have any other kind of profiling in it, which is something I expect in a commercial tool like that).

Maybe GlowCode as was mentioned in other, similar questions, on SO when I searched before asking.




回答6:


There is also application verifier. It can track a whole bunch of other issues as well apart from leaks like places where you forget to free win32 objects such as handles etc ...

The MSDN link is: http://msdn.microsoft.com/en-us/library/ms220948(VS.80).aspx




回答7:


Jacob, the BoundsChecker tool inside DevPartner Studio contains two types of leak detectors for VC++. The uninstrumented version will tabulate leaks at process shutdown. The compile time instrumented detector will break on leaks at the time the leak occurrs showing both the current call stack at the point of leakage, and the allocation stack trace showing where the leaking memory was allocated. The 64-bit version of DPS and BoundsChecker 10.5 ships February 4, 2011 with x64 application support for Visual Studio 2010, 2008, and 2005. We also have a new pricing model so you can license just the BoundsChecker features and ugrade to the full DPS suite only if you find you need the other profilers or static analysis capabilities later on. Be sure to haggle with your sales rep too. Paying list price is like paying sticker price on a new car. Shameless plug: I work on the DevPartner team. DPS 10.5 represents my team's biggest release of tech capability since Compuware closed the NuMega lab. Please evaluate it for your own application and tech stack when 10.5 goes live. Cheers. Matt Schuetze, DevPartner Product Owner (and yes that means PO in normal Scrum team roles.)




回答8:


VLD cannot be trusted for more serious projects.

Intel has a good tool called Inspector.

After 3 days searching for a good tool to find leaks on x64 binaries with C++ in Visual Studio, this is the only good option I found.




回答9:


Try Dr.Memory. They have proper visual studio integration and documentation is excellent. Easy to use too.




回答10:


http://www.saunalahti.fi/~tarmpika/diagnostic/

I had tried so many memory leak detectors that it's difficult to count them all. Some of them crashed, some of them produced invalid results, some of them simply did not help. Eventually I've made my own leak detector, but invested so much effort into it - so made it non-free for time being. Managed / native / 32 & 64-bit architectures supported.



来源:https://stackoverflow.com/questions/2820223/visual-c-memory-leak-detection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!