Garbage Collection ETW Events

.NET Framework (current version)
 

These events collect information pertaining to garbage collection. They help in diagnostics and debugging, including determining how many times garbage collection was performed, how much memory was freed during garbage collection, and so on.

This category consists of the following events:

The following table shows the keyword and level. (For more information, see CLR ETW Keywords and Levels.)

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCStart_V11A garbage collection has started.

The following table shows the event data.

Field nameData typeDescription
Countwin:UInt32The nth garbage collection.
Depthwin:UInt32The generation that is being collected.
Reasonwin:UInt32Why the garbage collection was triggered:

0x0 - Small object heap allocation.

0x1 - Induced.

0x2 - Low memory.

0x3 - Empty.

0x4 - Large object heap allocation.

0x5 - Out of space (for small object heap).

0x6 - Out of space (for large object heap).

0x7 - Induced but not forced as blocking.
Typewin:UInt320x0 - Blocking garbage collection occurred outside background garbage collection.

0x1 - Background garbage collection.

0x2 - Blocking garbage collection occurred during background garbage collection.
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCEnd_V12The garbage collection has ended.

The following table shows the event data.

Field nameData typeDescription
Countwin:UInt32The nth garbage collection.
Depthwin:UInt32The generation that was collected.
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDDescription
GCHeapStats_V14Shows the heap statistics at the end of each garbage collection.

The following table shows the event data.

Field nameData typeDescription
GenerationSize0win:UInt64The size, in bytes, of generation 0 memory.
TotalPromotedSize0win:UInt64The number of bytes that are promoted from generation 0 to generation 1.
GenerationSize1win:UInt64The size, in bytes, of generation 1 memory.
TotalPromotedSize1win:UInt64The number of bytes that are promoted from generation 1 to generation 2.
GenerationSize2win:UInt64The size, in bytes, of generation 2 memory.
TotalPromotedSize2win:UInt64The number of bytes that survived in generation 2 after the last collection.
GenerationSize3win:UInt64The size, in bytes, of the large object heap.
TotalPromotedSize3win:UInt64The number of bytes that survived in the large object heap after the last collection.
FinalizationPromotedSizewin:UInt64The total size, in bytes, of the objects that are ready for finalization.
FinalizationPromotedCountwin:UInt64The number of objects that are ready for finalization.
PinnedObjectCountwin:UInt32The number of pinned (unmovable) objects.
SinkBlockCountwin:UInt32The number of synchronization blocks in use.
GCHandleCountwin:UInt32The number of garbage collection handles in use.
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCCreateSegment_V15A new garbage collection segment has been created. In addition, when tracing is enabled on a process that is already running, this event is raised for each existing segment.

The following table shows the event data.

Field nameData typeDescription
Addresswin:UInt64The address of the segment.
Sizewin:UInt64The size of the segment.
Typewin:UInt320x0 - Small object heap.

0x1 - Large object heap.

0x2 - Read-only heap.
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.

Note that the size of segments allocated by the garbage collector is implementation-specific and is subject to change at any time, including in periodic updates. Your app should never make assumptions about or depend on a particular segment size, nor should it attempt to configure the amount of memory available for segment allocations.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCFreeSegment_V16A garbage collection segment has been released.

The following table shows the event data.

Field nameData typeDescription
Addresswin:UInt64The address of the segment.
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCRestartEEBegin_V17Resumption from common language runtime suspension has begun.

No event data.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IdRaised when
GCRestartEEEnd_V13Resumption from common language runtime suspension has ended.

No event data.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCSuspendEE_V19Start of suspension of the execution engine for garbage collection.

The following table shows the event data.

Field nameData typeDescription
Reasonwin:UInt160x0 - Other.

0x1 - Garbage collection.

0x2 - Application domain shutdown.

0x3 - Code pitching.

0x4 - Shutdown.

0x5 - Debugger.

0x6 - Preparation for garbage collection.
Countwin:UInt32The GC count at the time. Usually, you would see a subsequent GC Start event after this, and its Count would be this Count + 1 as we increase the GC index during a garbage collection.
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.

Back to top

The following table shows the keyword and level:

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information:

EventEvent IDRaised when
GCSuspendEEEnd_V18End of suspension of the execution engine for garbage collection.

No event data.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCAllocationTick_V210Each time approximately 100 KB is allocated.

The following table shows the event data.

Field nameData typeDescription
AllocationAmountwin:UInt32The allocation size, in bytes. This value is accurate for allocations that are less than the length of a ULONG (4,294,967,295 bytes). If the allocation is greater, this field contains a truncated value. Use AllocationAmount64 for very large allocations.
AllocationKindwin:UInt320x0 - Small object allocation (allocation is in small object heap).

0x1 - Large object allocation (allocation is in large object heap).
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.
AllocationAmount64win:UInt64The allocation size, in bytes. This value is accurate for very large allocations.
TypeIdwin:PointerThe address of the MethodTable. When there are several types of objects that were allocated during this event, this is the address of the MethodTable that corresponds to the last object allocated (the object that caused the 100 KB threshold to be exceeded).
TypeNamewin:UnicodeStringThe name of the type that was allocated. When there are several types of objects that were allocated during this event, this is the type of the last object allocated (the object that caused the 100 KB threshold to be exceeded).
HeapIndexwin:UInt32The heap where the object was allocated. This value is 0 (zero) when running with workstation garbage collection.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCFinalizersBegin_V114The start of running finalizers.

No event data.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCFinalizersEnd_V113The end of running finalizers.

The following table shows the event data.

Field nameData typeDescription
Countwin:UInt32The number of finalizers that were run.
ClrInstanceIDwin:UInt16Unique ID for the instance of CLR or CoreCLR.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCCreateConcurrentThread_V111Concurrent garbage collection thread was created.

No event data.

Back to top

The following table shows the keyword and level.

Keyword for raising the eventLevel
GCKeyword (0x1)Informational (4)
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
GCTerminateConcurrentThread_V112Concurrent garbage collection thread was terminated.

No event data.

CLR ETW Events

Show: