COR_PRF_GC_GENERATION Enumeration

Identifies a garbage-collection generation.

Syntax

typedef enum {  
    COR_PRF_GC_GEN_0 = 0,  
    COR_PRF_GC_GEN_1 = 1,  
    COR_PRF_GC_GEN_2 = 2,  
    COR_PRF_GC_LARGE_OBJECT_HEAP = 3,
    COR_PRF_GC_PINNED_OBJECT_HEAP= 4
} COR_PRF_GC_GENERATION;  

Members

Member Description
COR_PRF_GC_GEN_0 The object is stored as generation 0.
COR_PRF_GC_GEN_1 The object is stored as generation 1.
COR_PRF_GC_GEN_2 The object is stored as generation 2.
COR_PRF_GC_LARGE_OBJECT_HEAP The object is stored in the large-object heap.
COR_PRF_GC_PINNED_OBJECT_HEAP The object is stored in the pinned-object heap.

Remarks

The garbage collector improves memory management performance by dividing objects into generations based on age. The garbage collector currently uses three generations, numbered 0, 1, and 2, and two special heap segments, one for large objects and one for pinned objects.

Objects whose size is larger than a threshold value are stored in the large-object heap. Pinned objects can be allocated to the pinned-object heap to avoid the performance cost of allocating them on the normal heaps. Other allocated objects start out belonging to generation 0. All objects that exist after garbage collection occurs in generation 0 are promoted to generation 1. Objects that exist after garbage collection occurs in generation 1 move into generation 2.

The use of generations means that the garbage collector has to work with only a subset of the allocated objects at any one time.

The COR_PRF_GC_GENERATION enumeration is used by the COR_PRF_GC_GENERATION_RANGE structure.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 2.0

See also