高频堆 [英] High Frequency Heap

查看:183
本文介绍了高频堆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释我的CLR的HighFrequencyHeap?

Can anyone explain me the CLR's "HighFrequencyHeap"?

推荐答案

高频堆是用来存储常用的内部数据结构,诸如类型的方法表中。这可以使用的WinDbg / SOS如下所示进行验证。

The high frequency heap is used to store commonly used internal data structures such as the method table of types. This can be verified using WinDbg/SOS as shown below.

这也说明在 SSCLI书(第235页) 。

It is also stated in the SSCLI book (p. 235).

下面是输出的一部分!eeheap

--------------------------------------
Domain 1:          006428c0
LowFrequencyHeap:  00340000(2000:2000) Size: 0x2000 (8192) bytes.
HighFrequencyHeap: 00342000(8000:2000) Size: 0x2000 (8192) bytes.
StubHeap:          Size: 0x0 (0) bytes.
Virtual Call Stub Heap:
  IndcellHeap:     Size: 0x0 (0) bytes.
  LookupHeap:      Size: 0x0 (0) bytes.
  ResolveHeap:     Size: 0x0 (0) bytes.
  DispatchHeap:    Size: 0x0 (0) bytes.
  CacheEntryHeap:  Size: 0x0 (0) bytes.
Total size:        Size: 0x4000 (16384) bytes.
--------------------------------------
Jit code heap:
LoaderCodeHeap:    004e0000(10000:1000) Size: 0x1000 (4096) bytes.
Total size:        Size: 0x1000 (4096) bytes.
--------------------------------------
Module Thunk heaps:
Module 5ef21000: Size: 0x0 (0) bytes.
Module 00342e9c: Size: 0x0 (0) bytes.
Total size:              Size: 0x0 (0) bytes.
--------------------------------------
Module Lookup Table heaps:
Module 5ef21000: Size: 0x0 (0) bytes.
Module 00342e9c: Size: 0x0 (0) bytes.
Total size:              Size: 0x0 (0) bytes.
--------------------------------------
Total LoaderHeap size:   Size: 0x13000 (77824) bytes.
=======================================
Number of GC Heaps: 1
generation 0 starts at 0x02521018
generation 1 starts at 0x0252100c
generation 2 starts at 0x02521000
ephemeral segment allocation context: none
 segment     begin allocated  size
02520000  02521000  0252e010  0xd010(53264)
Large object heap starts at 0x03521000
 segment     begin allocated  size
03520000  03521000  03523250  0x2250(8784)
Total Size:              Size: 0xf260 (62048) bytes.
------------------------------
GC Heap Size:            Size: 0xf260 (62048) bytes.

注意高频堆的位置和垃圾回收堆。下面是输出!dumpobject 程序的静态分配的实例

0:000> !dumpheap -type Program
 Address       MT     Size
0252b630 00343858       12     
total 0 objects
Statistics:
      MT    Count    TotalSize Class Name
00343858        1           12 TestBench2010.Program
Total 1 objects
0:000> !do 0252b630 
Name:        TestBench2010.Program
MethodTable: 00343858
EEClass:     0034154c
Size:        12(0xc) bytes
File:        C:\workspaces\TestBench2010\TestBench2010\bin\Debug\TestBench2010.exe
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
00343858  4000001        4 ...Bench2010.Program  0   static 0252b630 p
0:000> !dumpheap -type Program
 Address       MT     Size
0252b630 00343858       12     
total 0 objects
Statistics:
      MT    Count    TotalSize Class Name
00343858        1           12 TestBench2010.Program
Total 1 objects
0:000> !do 0252b630 
Name:        TestBench2010.Program
MethodTable: 00343858
EEClass:     0034154c
Size:        12(0xc) bytes
File:        C:\workspaces\TestBench2010\TestBench2010\bin\Debug\TestBench2010.exe
Fields:
  MT    Field   Offset                 Type VT     Attr    Value Name
00343858  4000001        4 ...Bench2010.Program  0   static 0252b630 p

注意地址的类型计划静态参考 P 。它指出,在垃圾回收堆中的地址。另外,注意的方法表的地址。它指向在高频堆的地址。

Notice the address for the static reference p in the type Program. It points to an address in the garbage collected heap. Also, notice the address of the Method Table. It points to an address in the high frequency heap.

这篇关于高频堆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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