我的堆是否碎片化
0:000> !dumpheap -stat
total 1755874 objects
Statistics:
MT Count TotalSize Class Name
7b9b0c64 1 12 System.Windows.Forms.Layout.TableLayout+ColumnSpanComparer
....
7933303c 14006 4926456 System.Collections.Hashtable+bucket[]
65246e00 804 4982192 System.Data.RBTree`1+Node[[System.Int32, mscorlib]][]
054c55f0 44240 5662720 DevExpress.Utils.AppearanceObject
793040bc 98823 7613156 System.Object[]
793308ec 293700 55820016 System.String
002435f0 50315 138631888 Free
Total 1755874 objects
Fragmented blocks larger than 0.5 MB:
Addr Size Followed by
15a195c8 0.8MB 15ae3950 System.Collections.ArrayList
15d81468 1.6MB 15f23708 System.String
15f23984 1.0MB 16029ae4 System.String
... about 7 more objects here
1ee51764 0.5MB 1eedbaa4 System.WeakReference
1f0df96c 2.4MB 1f34d4b0 System.String
1f3e1ca8 3.7MB 1f79afc4 System.WeakReference
我一直在阅读有关固定和碎片的内容。 考虑到大量的可用空间,它在我看来是支离破碎的。 我想我现在必须追踪它。
想法? 反馈?
0:000> !dumpheap -stat
total 1755874 objects
Statistics:
MT Count TotalSize Class Name
7b9b0c64 1 12 System.Windows.Forms.Layout.TableLayout+ColumnSpanComparer
....
7933303c 14006 4926456 System.Collections.Hashtable+bucket[]
65246e00 804 4982192 System.Data.RBTree`1+Node[[System.Int32, mscorlib]][]
054c55f0 44240 5662720 DevExpress.Utils.AppearanceObject
793040bc 98823 7613156 System.Object[]
793308ec 293700 55820016 System.String
002435f0 50315 138631888 Free
Total 1755874 objects
Fragmented blocks larger than 0.5 MB:
Addr Size Followed by
15a195c8 0.8MB 15ae3950 System.Collections.ArrayList
15d81468 1.6MB 15f23708 System.String
15f23984 1.0MB 16029ae4 System.String
... about 7 more objects here
1ee51764 0.5MB 1eedbaa4 System.WeakReference
1f0df96c 2.4MB 1f34d4b0 System.String
1f3e1ca8 3.7MB 1f79afc4 System.WeakReference
I've been reading about pinning and fragmentation. Its looking fragmented to me given the massive amount of free space. I guess I have to now track it down.
Thoughts? feedback?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以...我们知道我们有一个碎片堆。 下一个问题是:是什么导致了碎片? 是什么阻止了这些免费对象被释放? 我读到的建议是检查可用空间之后的对象:
!dumpheap -stat
转储可用对象的方法表: !dumpheap -mt 000db8e8
从列表中选择一个 Free 对象进行更仔细的检查: !dumpobj 0x2003b0b0
记录对象的大小
转储其后的下一个对象: !dumpobj 0x2003b0b0+1000
转储其后
转储找到的对象的 gchandle。
我通常会陷入这个兔子洞,而我对 .NET API 的有限知识在这里失败了。 这是调试问题的正确方法吗?
杰夫
So...we know we have a fragmented heap. The next question is: what's causing the fragmentation? What's keeping these free objects from being released? The recommendations I have read is to examine the objects right after the free space:
!dumpheap -stat
Dump the method table of the Free object: !dumpheap -mt 000db8e8
Select one Free object from the list to examine more closely: !dumpobj 0x2003b0b0
Record the object's size
Dump the next object after it: !dumpobj 0x2003b0b0+1000
Find the object holding a reference !gcroot 0x2003b0b0+1000
Dump the gchandle of the object found.
I usually get down this rabbit hole, and my limited knowledge of the .NET API fails here. Is this the correct way to debug the problem?
Jeff