我在托管堆中有好几百个 MyClass 实例。其中一些位于大对象堆中。下面是各种堆结构的示意图:
0:000> !EEHeap -gc
Number of GC Heaps: 1
generation 0 starts at 0x0000000002df9de8
generation 1 starts at 0x0000000002dc6710
generation 2 starts at 0x0000000002a01000
ephemeral segment allocation context: none
segment begin allocated size
0000000002a00000 0000000002a01000 0000000002e3c2c0 0x43b2c0(4436672)
Large object heap starts at 0x0000000012a01000
segment begin allocated size
0000000012a00000 0000000012a01000 000000001a5ed558 0x7bec558(129942872)
000000002a980000 000000002a981000 00000000328110b8 0x7e900b8(132710584)
0000000033e00000 0000000033e01000 000000003bd80d78 0x7f7fd78(133692792)
000000001daf0000 000000001daf1000 0000000025996188 0x7ea5188(132796808)
00000000542b0000 00000000542b1000 000000005a4bf100 0x620e100(102818048)
000000005c2b0000 000000005c2b1000 000000006344df88 0x719cf88(119132040)
000000007fff0000 000000007fff1000 00000000878bfbc0 0x78cebc0(126675904)
Total Size: Size: 0x34956418 (882205720) bytes.
------------------------------
GC Heap Size: Size: 0x34956418 (882205720) bytes.
我的问题有:
1. 如何找到大对象堆中所有MyClass实例的地址。
2. 是否有办法在大对象堆中运行!ObjSize以查看这些MyClass实例的大小?
!DumpHeap
。 - Hans Passant