调试应用程序巨大的内存泄漏 [英] Debugging huge memory leak in application

查看:158
本文介绍了调试应用程序巨大的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用才刚刚泄漏的内存1.5GB。我想,因为我没有一吨提供给我的数据,我猜想,它的泄漏内存,但它也可能只是抓着它。

My application has just leaked 1.5GB of memory. I guess since I don't have a ton of data available to me, I'm assuming that it's leaked the memory, but it could also just be holding onto it.

我目前使用性能监视器来收集尽可能多的信息,我可以,试图了解这可能会造成问题。我没有在这一点上有一大堆的线索,并希望能够得到这里的人们更多的提示。

I'm currently using perfmon to gather as much information as I can, to try to understand what could be causing the problem. I don't have a whole lot of leads at this point, and was hoping to get more hints from people here.

  1. 我能说的第一件事是,我没有在我的任何类实现IDisposable。但是,我知道,我不调用Dispose在任何GUI元素,像的SolidColorBrush的。由于我的应用程序不是图形密集型以任何方式,我想这不能造成问题的原因。然而,我会添加必要的调用。

  1. The first thing I can say is that I do not implement IDisposable in any of my classes. However, I know I do not call Dispose on any of the GUI elements, like SolidColorBrush. As my app isn't graphics-intensive by any means, I figure this can't be causing the problem. However, I will add the necessary calls.

我不,如果我使用任何其他类在实现IDisposable框架知道。我读到这里后上SO 有关的FxCop。我安装和使用它来分析我的装配,但它似乎只检查我自己的类正确实施了IDisposable的。有另一种工具,可以告诉我,实现IDisposable的所有类?

I don't know if I'm using any other classes in the framework that implement IDisposable. I read a post here on SO about FxCop. I installed and used it to analyze my assembly, but it seems to only check for my own classes' correct implementation of IDisposable. Is there another tool that can tell me ALL classes that implement IDisposable?

我目前使用在我的应用WF和世界粮食首脑会议正在不断推出和成品。性能监视器显示,世界粮食首脑会议即将结束正常,我现在用的是使用的关键字,这是我理解我,妥善处置交易。

I'm currently using WF in my application, and WFs are constantly being launched and finished. Perfmon shows that WFs are ending properly, and I am using the "using" keyword, which I understand deals with proper disposal for me.

有没有一种简单的方法来判断是否被泄露的记忆是从非托管或管理code?

Is there a simple way to tell if the memory being "leaked" is from unmanaged or managed code?

该应用程序是用77K +处理在我的OOM异常的时间。

The app was using 77k+ handles at the time I got the OOM exception.

如何进行下一个会是极大的AP preciated任何提示。我就准备再次运行应用程序,并监视性能计数器,或许删空某些呼叫。我也可以运行的模拟比较的缘故,因为在这种模式下,它不会打电话到我的C DLL。

Any tips on how to proceed next would be greatly appreciated. I am planning on running the app again and monitoring the performance counters, and maybe stubbing out certain calls. I can also run the simulation for comparison's sake, since in that mode it won't call into my C DLL.

推荐答案

苔丝Ferrandez拥有的一些博客文章这可能是你的兴趣。

Tess Ferrandez has a number of blog posts that could be of interest to you.

  • <一个href="http://blogs.msdn.com/tess/archive/2009/02/27/net-memory-leak-reader-email-are-you-really-leaking-net-memory.aspx"相对=nofollow> NET内存泄漏的读者电子邮件:你真的泄漏。NET内存

<一个href="http://blogs.msdn.com/tess/archive/2009/02/03/net-memory-leak-to-dispose-or-not-to-dispose-that-s-the-1-gb-question.aspx" 。相对=nofollow> NET内存泄漏:处理或不处理掉,这就是1 GB的问题

此外蚂蚁内存分析器是查找泄漏一个伟大的工具。

Also ANTS Memory Profiler is a great tool for finding leaks.

这篇关于调试应用程序巨大的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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