.NET 4.0上的内存泄漏或垃圾回收问题 [英] Memory Leak or Garbage Collection problem on .Net 4.0

查看:63
本文介绍了.NET 4.0上的内存泄漏或垃圾回收问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在.Net 2.0框架上开发的非常复杂且图形密集的应用程序(app).该应用程序还占用大量内存并具有多线程,并且还使用.Net Remoting两个与数据层进行通信.最初,该应用程序是在Windows上运行的 XP平台,后来又迁移到Vista和Windows7.尽管它曾经而且占用大量内存,但它曾经在XP和Windows XP上将对象(例如,关闭了图形编辑表单)销毁后很快就释放了内存.在Vista上,但在Windows上 7内存根本没有被释放或很晚才释放,从而导致MemomyOutofRange异常.

I have a very complex and graphic intensive application (app) developed on .Net 2.0 framework. The app is also very memory intensive and multi-threaded and also uses .Net Remoting two communicate with the data layer. Initially, the app was run on Windows XP platform and later it was migrated to Vista and then Windows 7. Though it was and is memory intensive, it used to free up the memory very quickly as soon as an object was disposed (e.g. a graphics editing form was closed) on XP and on Vista, but on Windows 7 the memory is not freed up at all or very late, causing a MemomyOutofRange exception.

问题是:

  • 有人遇到过类似的问题吗?
  • 是因为.Net 4.0的体系结构或垃圾收集器发生了任何变化吗?
  • 如果它是垃圾收集器,并且.Net 4.0可能仍将对象识别为活动对象,那么如何从GC中识别这些对象?
  • 如何在不花费大量时间的情况下解决该问题?
  • Did anyone face similar problem(s)?
  • Is it because of any change in the architecture of .Net 4.0 or the garbage collector?
  • If it is the garbage collector and probably .Net 4.0 is still recognizing objects as live objects, how can these objects be recognized from the GC?
  • How can this be fixed without spending a lot of time?

任何对此事的见识将受到高度赞赏.

Any insight on this matter will be highly appreciated.

谢谢.

Ashik Rahman

Ashik Rahman

推荐答案

如果在WinDbg中打开故障转储,则可以列出特定类型的所有实例.找到您认为应该清除的类型的实例,然后在对象上执行!gcRoot,以了解其仍是根的.
If you open the crash dump in WinDbg, you can have it list all instances of a certain type. Find an instance of the type you think should be cleaned up and do a !gcRoot on the object to find out how it's still rooted.


这篇关于.NET 4.0上的内存泄漏或垃圾回收问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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