如何在Windows上进行内存分析? [英] How to do memory profiling on Windows?

查看:204
本文介绍了如何在Windows上进行内存分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
Windows下C ++的内存泄漏工具

Possible Duplicate:
Memory leak tool for C++ under Windows

我曾经在Mac项目上工作,而我对XCode真正喜欢的一件事是它的探查器.通过使用该探查器的各种设置运行程序,我发现了许多错误.最值得注意的是,它会告诉我程序的哪些部分消耗了内存,会告诉我是否泄漏了内存,并且会告诉我何时执行此操作.如果我使用的是GUI应用程序,它甚至会向我显示这些分配/泄漏/解除分配发生时我正在做什么的屏幕截图.

I used to work on a Mac project and one thing I really enjoyed about XCode was its profiler. I found many a bug by just running my program with various settings of that profiler. Most notably, it would show me which parts of my program consumed memory, it would show me if it leaked memory and it would show me when it would do that. If I was working with a GUI application, it would even show me screenshots of what I was doing when those allocations/leaks/deallocations occurred.

如今,我正在使用Visual Studio处理Windows/C ++项目,我怀疑该项目消耗了太多内存,并且可能还会泄漏一些内存.使用XCode,我只需启动该探查器并立即知道发生了什么事.但是,在Visual Studio中,我找不到这样的东西(有一个有点尴尬的性能分析器,但是CPU时间不是我关心的问题.)

Nowadays, I am working on a Windows/C++ project using Visual Studio and I suspect the project to consume too much memory and possibly leak some memory, too. Using XCode, I would just fire up that profiler and immediately know what's happening. In Visual Studio however, I can find no such thing (there is a somewhat awkward performance profiler, but CPU time is not my concern here).

那么,您将如何查找内存消耗过多的泄漏和代码?

So, how would you go about searching for leaks and code with too much memory consumption?

推荐答案

请参见应用程序验证程序,LeakDiag,UMDH和一般用于Windows的调试工具.

See Application Verifier, LeakDiag, UMDH, and Debugging Tools for Windows in general.

所有这些都是免费的.

有关如何使用它们的指南,请参见高级Windows调试.

For a guide on how to use them, see Advanced Windows Debugging.

这篇关于如何在Windows上进行内存分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆