VS2010 分析仪/泄漏检测
有人知道可以与 VS2010 代码一起使用的分析器和泄漏检测器吗?最好是Win7下运行的。
我在这里和谷歌搜索过。我发现了一种有效的检漏仪(内存验证器),但我并没有太印象深刻。一方面,它显示了一堆菜单泄漏和我相当有信心的东西不是真实的。我也尝试过 GlowCode,但它只是一个分析器,拒绝在 win7 上安装。
我以前用过AQtime。它拥有我需要的一切,内存/资源泄漏检测、分析各种事物、静态分析等。不幸的是,它现在给出了虚假结果。
我面临的主要问题是 VS2010 说某个程序存在泄漏,而 VS2005 中没有泄漏。我几乎可以肯定这是误报,但我似乎找不到一个好的工具来验证这一点。内存验证器没有显示相同的内容,并且 VS 的泄漏报告似乎不合理。
Anyone know of a profiler and leak detector that will work with VS2010 code? Preferably one that runs on Win7.
I've searched here and in google. I've found one leak detector that works (Memory Validator) but I'm not too impressed. For one thing it shows a bunch of menu leaks and stuff which I'm fairly confident are not real. I also tried GlowCode but it's JUST a profiler and refuses to install on win7.
I used to use AQtime. It had everything I needed, memory/resource leak detection, profiling various things, static analysis, etc. Unfortunately it gives bogus results now.
My main immediate issue is that VS2010 is saying there are leaks in a program that had none in VS2005. I'm almost certain it's false positives but I can't seem to find a good tool to verify this. Memory Validator doesn't show the same ones and the reporting of leaks from VS doesn't seem rational.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
要查找内存泄漏,您可以尝试视觉泄漏检测工具。
For finding memory leaks you can try Visual Leak Detection tool.
Noah,正如 Ori 提到的,Micro Focus 的 DevPartner Studio 具有泄漏检测和其他运行时分析功能。与 Compuware 下 DPS 的高价不同,您现在可以仅许可运行时分析器,而不是整个套件(如果您需要的话)。无耻插件:我在 DevPartner 团队工作。我们的 64 位应用程序支持在 2011 年 2 月 4 日发布的 10.5 版本中提供。请在 http:// www.DevPartner.com。
Noah, as Ori mentioned, DevPartner Studio from Micro Focus has both leak detection and other runtime profiling features. Unlike the lofty prices DPS had under Compuware, you can now license just the runtime profilers and not the whole suite if that's what you need. Shameless plug: I work on the DevPartner team. Our 64-bit application support ships in the 10.5 release on February 4, 2011. Look for release news and eval downloads on http://www.DevPartner.com.
就我个人而言,我喜欢 DevPartner。如果您在一家大公司工作,也许您可以说服他们支付巨额许可证费用。它很贵,但是非常非常坚固。
Personally, I'm fond of DevPartner. If you work in a big company, maybe you can convince them to pay for the hefty license. It's expensive, but it's very very sturdy.
我使用了几种商业替代方案,尽管它们可以提供出色的结果,但它们也经常因为未知的原因而无法工作:
在过去的几年里,我又回到了对应用程序进行采样的相当粗略的方式。这不像使用仪器那样完美,但它速度更快,可以在任何应用程序上运行并且始终有效。我最喜欢的是“非常困”(http://www.codersnotes.com/sleepy),但也Luke StackWalker (http://lukestackwalker.sourceforge.net/) 相当不错。由于应用程序可以立即运行并且不会出现明显的速度减慢,因此“更改应用程序、配置文件”循环非常短且高效。
为了查找内存泄漏,您可以使用 Windows 中的多种工具。同样,它们远非完美,并且通常只能从外部调查正在运行的应用程序,而不是简单地在应用程序结束时报告泄漏。查找“Microsoft 调试工具”(UMDH、LeakDiag、gflags)。就我个人而言,我发现编写自己的内存管理器并让它在应用程序结束时报告泄漏要容易得多。写起来并不难。你要做的是:
I used several commercial alternatives and although they can deliver fantastic results, they also often simply fail to work because of unknown reasons:
In the last years I returned to the rather crude way of sampling the application. This is not as perfect as using instrumentation, but it's much faster, can be run on any application and always works. My favorite is "Very Sleepy" (http://www.codersnotes.com/sleepy) but also Luke StackWalker (http://lukestackwalker.sourceforge.net/) is quite good. Because the applications can be run immediately and without a noticeable slowdown, the "change app, profile" loop is very short and efficient.
For finding memory leaks, there are several tools in Windows that you can use. Again, they are far from perfect, and often can only investigate running applications from the outside, not simply reporting leaks at the end of the application. Look for the "Microsoft Debugging Tools" (UMDH, LeakDiag, gflags). Personally, I find it much easier just to write my own memory manager, and let it report the leaks at the end of the application. It's not that hard to write. What you have to do is:
这里也有非常简单易用的泄漏检测代码: http://www.codeproject .com/kb/cpp/MemLeakDetect.aspx
There's really simple and easy to use Leak Detection code here too: http://www.codeproject.com/kb/cpp/MemLeakDetect.aspx
不知道如何链接到这个,我之前发布过类似的问题:
您可以使用 umdh.exe 捕获并比较泄漏发生之前和之后的进程快照。这对于调试二进制文件效果最好,但对于发布版本也可行,前提是符号路径设置正确 - 它将为您提供在第一个和第二个快照之间分配的内存的调用堆栈。
http://support.microsoft.com/kb/268343
这种方法的优点是自由的。
Not sure how to link to this, which I previously posted in response to a similar question:
You can use umdh.exe to capture and compare snapshots of the process before and after leak happens. This works best with Debug binaries but is viable with Release provided symbol paths are correctly set - it will give you the callstacks of memory allocated between the 1st and the 2nd snapshot.
http://support.microsoft.com/kb/268343
This approach has the advantage of being free.