.NET应用程序的内存使用情况 - 高未使用.NET和非托管内存和碎片 [英] .NET application memory usage - high unused .NET and unmanaged memory and fragmentation

查看:293
本文介绍了.NET应用程序的内存使用情况 - 高未使用.NET和非托管内存和碎片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用蚂蚁内存分析器来诊断我面临着在我的.NET 2.0的应用程序之一增加了内存泄漏。 我把这个过程的7快照历时7.5小时,这里是数据的表格重新presentation获得 -

I am using ANTS memory profiler to diagnose an increase in memory leak I am facing in one of my .NET 2.0 applications. I took 7 snapshots of the process over a period of 7.5 hours, and here is a tabular representation of the data obtained -

G1 reprsents第1代的尺寸和G2第2代的尺寸。除了非托管空间和专用字节,所有其他值都在MB。

G1 reprsents generation 1 size and G2 generation 2 size. Except for the unmanaged space and private bytes, all other values are in MB.

我的问题是 -

  1. 为什么会出现,即使堆的大小是低?

  1. Why is there such high unused .NET space even when the heap sizes are low ?

我的大对象堆进到最多约2 MB和在过去的3快照保持在96字节。那么,为什么会有这么高的大片段,且他们负责的高度未使用的空间?

My large object heap goes to a maximum of some 2 MB, and during the last 3 snapshots remains at 96 KB. Then why is there such high large fragments, and are they responsible for the high unused space ?

非托管空间不断增大。那是负责随时间增加专用字节?

The unmanaged space increases constantly. Is that responsible for an increase in private bytes over time ?

我在我束手无策,解决这个问题,并且已经进行了多次的分析,但不能找到一个妥善的解决了这一点。我已经准备好提供所需的任何其他数据。

I am at my wit's end to solve this issue, and have performed several analyses but cant find a proper solution to this. I am ready to provide any other data needed.

推荐答案

亚历克斯已经指出的问题类的大型对象堆碎片的一个非常好的解释是这里找到:

As Alex already pointed out a very nice explanation of the problem class large object heap fragmentation is found here:

https://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/

这个问题是众所周知的,在.NET FX开发团队,并不断在了工作。 这是一个很好的机会,症状消失过使用较新的FX版本。

The problem is well known in the .NET FX Dev Team and continuously been worked at. There is a good chance that the symptoms fade off using more recent FX releases.

与.NET 4.5.1开始会有一个GC方法调用,甚至紧凑蕙: <一href="http://blogs.msdn.com/b/mariohewardt/archive/2013/06/26/no-more-memory-fragmentation-on-the-large-object-heap.aspx" rel="nofollow">http://blogs.msdn.com/b/mariohewardt/archive/2013/06/26/no-more-memory-fragmentation-on-the-large-object-heap.aspx 然而,找到LOHF的根本原因是方式更有效的不仅仅是擦堆浪费吨毫秒的吧

Starting with .NET 4.5.1 there will be a GC method call to even compact the LOH: http://blogs.msdn.com/b/mariohewardt/archive/2013/06/26/no-more-memory-fragmentation-on-the-large-object-heap.aspx However, finding the root cause of the LOHF would be way more efficient than just wiping it of the heap wasting tons of ms's

让我知道,如果你需要进一步的细节如何分离这样的效果。

Let me know, if you need further details how to isolate such effects.

勒布

这篇关于.NET应用程序的内存使用情况 - 高未使用.NET和非托管内存和碎片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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