我可以使用什么工具来分析内存使用情况? [英] What tool can I use to analyze memory usage?

查看:74
本文介绍了我可以使用什么工具来分析内存使用情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Visual Studio 2008用C ++编写的Windows应用程序.我想获取有关内存使用情况的统计信息,以查找瓶颈和可以处理内存使用情况的位置.理想情况下,我希望有一个无需执行此操作即可在代码本身中添加计数器/配置逻辑的工具.基本上我正在寻找的是:

I have a Windows application written using C++ using Visual Studio 2008. I want to obtain statistics on memory usage to find bottlenecks and locations to work on memory usage. Ideally I'd like to have a tool that does this without having to go in and add counter/profiling logic to the code itself. Basically what I'm looking for is:

  • 所有分配的列表(释放与否无关紧要,每次分配时我都想知道)
  • 每个分配的调用堆栈和一个代表代码被调用和分配内存的次数的计数器.
  • 有关已释放内存或未释放内存(查找泄漏)的信息.理想情况下,它应该足够智能,以确定内存是否仍在使用中或是否确实发生了泄漏(通过作用域或其他某种智能机制).

我不在乎它是否是免费工具.这是我已经看过的一些工具:

I don't care if it's a free tool or not. Here are some tools I've already looked at:

  • Rational PurifyPlus :坦白地说,我无法充分利用此工具.它返回许多误报.另外,它并没有给我上面列表中的前2个项目,而是只专注于内存错误和泄漏.
  • Sysinternals VMMap :这个工具很有趣,可以让我看到内存是如何分布的(堆栈,堆,共享堆等).它也让我看到分配的调用树,但不是很直观或没有帮助.很难从数据中弄清楚.
  • DevPartner Boundschecker :我真的认为这是迄今为止最没用的工具.几年前我用过它,在DevPartner将其收购之前,我记得它的工作要好得多.但这并没有真正提供我所需的统计数据,也似乎无法正确检测内存泄漏.
  • Rational PurifyPlus: Honestly I haven't been able to make much use of this tool. It returns a lot of false positives. Also, it doesn't give me the first 2 items in my list above, it instead seems to only focus on memory errors and leaks.
  • Sysinternals VMMap: This tool is interesting and allows me to see how memory is spread out (stack vs heap vs shared heap, etc). It also lets me see a call tree of allocations but isn't very intuitive or helpful. It's hard to make sense out of the data.
  • DevPartner Boundschecker: I really think this is the most useless tool so far. I used it years ago before they got bought out by DevPartner and I remember it working a lot better. But it doesn't really give me the statistical data I need, nor does it seem to be able to properly detect memory leaks.

我先感谢您提供的任何帮助/建议.我的应用程序是一台服务器,并且在压力测试期间会随着时间的推移出现严重的内存增长问题(并最终由于虚拟字节超过32位应用程序的限制而崩溃).拥有正确的工具将帮助我隔离出我们在哪里分配内存,以及我们可能在哪里泄漏内存.

I appreciate in advance any help / advice. My application is a server, and suffers serious memory growth issues over time during stress testing (and eventually crashes due to virtual bytes exceeding the limit for 32-bit applications). Having the right tool will help me isolate where we are allocating memory and also where we might be leaking memory.

推荐答案

在我的工作地点,我们使用软件验证的 内存验证器.它将为您提供各种内存统计信息,分配列表,每个分配的调用堆栈以及内存泄漏.在我的工作经验中,它有时被证明是有用的.

At my work location, we use Software Verification's Memory Validator. It will give you various memory statistics, lists of allocations, call stack of each allocation, and memory leaks. It has proven to be occasionally useful in my work experience.

这篇关于我可以使用什么工具来分析内存使用情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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