这个保留的地址空间被称为托管堆。
此内存不是clr托管堆内存。
但是,对于分析托管堆,它给人的印象非常深刻。
For analyzing the managed heap, however, it is very impressive.
最初,该指针设置为指向托管堆的基址。
Initially, this pointer is set to the managed heap's base address.
这样做可能会损坏托管堆。
每个根或者引用托管堆中的对象,或者设置为空。
Each root either refers to an object on the managed heap or is set to null.
它还将托管堆指针定位至最后一个可访问对象之后。
It also positions the managed heap's pointer after the last reachable object.
实际上,垃圾回收器在第0级托管堆已满时执行回收。
In reality, the garbage collector performs a collection when generation 0 is full.
如果托管堆中的所有对象均未被回收,则不需要压缩内存。
If all the objects in the managed heap survive a collection, then there is no need for memory compaction.
首先,压缩托管堆的一部分内存要比压缩整个托管堆速度快。
First, it is faster to compact the memory for a portion of the managed heap than for the entire managed heap.
然后垃圾回收器工作,试图穿过该托管堆,此时进程就会崩溃了。
Later on when the garbage collector is doing its work, it tries to go through the heap and things go bad so the process crashes.
垃圾回收器执行回收,尝试为对象释放第0级托管堆中的地址空间。
The garbage collector performs a collection in an attempt to free address space in generation 0 for the object.
只要托管堆中有地址空间可用,运行时就会继续为新对象分配空间。
As long as address space is available in the managed heap, the runtime continues to allocate space for new objects.
然后,垃圾回收器升级这些对象,并考虑第1级托管堆的这一部分。
The garbage collector then promotes these objects and considers this portion of the managed heap generation 1.
利用CLR探查器,可以查看进程的托管堆并调查垃圾回收器的行为。
The CLR Profiler enables you to view the managed heap of a process and investigate the behavior of the garbage collector.
ServerGC为每一个处理器分配一个托管堆和一个GC线程。
The server GC allocates one heap and one GC thread for each of processors.
应用程序创建第一个引用类型时,将为托管堆的基址中的类型分配内存。
When an application creates the first reference type, memory is allocated for the type at the base address of the managed heap.
在回收中,垃圾回收器检查托管堆,查找无法访问对象所占据的地址空间块。
During a collection, the garbage collector examines the managed heap, looking for the blocks of address space occupied by unreachable objects.
请想一想如果垃圾收集器每次总是扫描所有托管堆中的对象,对性能会有什么影响。
Please think about what will happen if garbage collector scans all the objects in the whole heap in every garbage collecting cycle.
垃圾收集器以自己的线程运行,从程序里移除未使用的内存,每次运行时也压缩托管堆。
The Garbage Collector runs in its own thread to remove unused memory from your program. It also compacts the managed heap each time it runs.
另外,由于连续分配的新对象在托管堆中是连续存储,所以应用程序可以快速访问这些对象。
In addition, because new objects that are allocated consecutively are stored contiguously in the managed heap, an application can access the objects very quickly.
请注意,托管堆在分配新对象方面非常有效,而垃圾回收器在收集大量生存期较短的小型对象方面非常有效。
Note that the managed heap is very efficient at allocating new objects, and the garbage collector is very efficient at collecting lots of small and short-lived objects.
另外,单独回收第0级托管堆通常可以回收足够的内存,这样,应用程序便可以继续创建新对象。
In addition, a collection of generation 0 alone often reclaims enough memory to allow the application to continue creating new objects.
垃圾回收器执行第0级托管堆的回收后,会压缩可访问对象的内存,如本主题前面的释放内存中所述。
After the garbage collector performs a collection of generation 0, it compacts the memory for the reachable objects as explained in Releasing memory earlier in this topic.
因此,垃圾回收器在每次执行第0级托管堆的回收时,不必重新检查第1级和第2级托管堆中的对象。
As a result, the garbage collector does not have to reexamine the objects in generations 1 and 2 each time it performs a collection of generation 0.
这可以消除基于.NET的应用程序中托管堆大小常见的锯齿模式,并且减少了应用程序为执行垃圾回收而花费的时间。
This can get rid of the sawtooth pattern often seen for the managed heap size in.net-based applications, and reduces the time an application spends performing garbage collection.
在执行第0级托管堆的首次回收并把可访问的对象升级至第1级托管堆后,垃圾回收器将考虑第0级托管堆的其余部分。
After the garbage collector performs its first collection of generation 0 and promotes the reachable objects to generation 1, it considers the remainder of the managed heap generation 0.
如果应用程序在第0级托管堆已满时尝试新建对象,垃圾回收器将会发现第0级托管堆中没有可分配给该对象的剩余地址空间。
If an application attempts to create a new object when generation 0 is full, the garbage collector discovers that there is no address space remaining in generation 0 to allocate for the object.
可扩展的集合在多处理器系统上运行的执行引擎的服务器版本(mscorsvr。DLL),托管堆分成几个部分,每一个CPU。
Scalable Collections on a multiprocessor system running the server version of the execution engine (MSCorSvr. DLL), the managed heap is split into several sections, one per CPU.
可扩展的集合在多处理器系统上运行的执行引擎的服务器版本(mscorsvr。DLL),托管堆分成几个部分,每一个CPU。
Scalable Collections on a multiprocessor system running the server version of the execution engine (MSCorSvr. DLL), the managed heap is split into several sections, one per CPU.
应用推荐