Visual C++ - Memory Leak Detection
Asked Answered
A

10

12

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

Assiut answered 12/5, 2010 at 15:22 Comment(6)
And what's wrong with _CRTDBG? Tracing though binary dumps not good enough for you, eh ;-)Goatherd
@Skizz: Scroll to the bottom :) msdn.microsoft.com/en-us/library/e5ewb1h3%28v=VS.80%29.aspxAssiut
CRT leak detection works fine as long as you set it up properly; of course it can be confusing at first, but once you figure it out you never forget :)Entrepreneur
Why are you looking for other tools? What is wrong with VLD? Is there a specific feature missing?Disruptive
I like how at the top of the Microsoft page, it says: This applies to: Visual studio express: NO standard: NO Pro: NO Meaning it applies to nothingRoband
Maybe it applies to "Ultimate"Ironhanded
D
6

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.

Dryasdust answered 9/8, 2010 at 20:33 Comment(0)
U
4

Try Deleaker or DevPartner, these both are good enough.

update:

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

Urias answered 13/5, 2010 at 9:2 Comment(0)
G
2

If you can afford some money use the Intel Parallel Inspector (https://www.intel.com/content/www/us/en/developer/tools/oneapi/inspector.html).

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.

Gesticulate answered 13/5, 2011 at 16:53 Comment(0)
O
1

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

Purify also works.

Octal answered 18/8, 2010 at 10:7 Comment(0)
C
0

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.

Cloudland answered 12/5, 2010 at 15:41 Comment(2)
It looks like you didn't receive many answers. I'll check out AQtime .. right now I'm using VLD which is similar to the default VS tool but more verbose.Assiut
I'm simply using a compiler that's too new. Hardly anyone has anything compatible with it out yet.Cloudland
G
0

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

Griz answered 14/8, 2010 at 4:4 Comment(0)
W
0

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

Weinrich answered 30/1, 2011 at 15:26 Comment(0)
G
0

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.

Gesticulate answered 25/2, 2011 at 18:33 Comment(0)
H
0

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

Hers answered 19/1, 2015 at 19:42 Comment(0)
C
0

https://sourceforge.net/projects/diagnostic/

http://diagnostic.sourceforge.net/index.html

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.

If you ever want to develop this tool further, please feel free to contact me.

Coray answered 9/2, 2016 at 17:37 Comment(1)
Updated link. But haven't touched that project for a long time.Coray

© 2022 - 2024 — McMap. All rights reserved.