You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`dotnet.gc.heap.generation`| string | Name of the maximum managed heap generation being collected. |`gen0`; `gen1`; `gen2`| Always |
52
+
|`gc.heap.generation`| string | Name of the maximum managed heap generation being collected. |`gen0`; `gen1`; `gen2`| Always |
53
53
54
54
The .NET GC is a generational garbage collector. Each time the garbage collector runs, it uses heuristics to select a maximum generation and then collects objects in all generations up to the selected maximum. For example, a `gen1` collection collects all objects in generations 0 and 1. A `gen2` collection collects all objects in generations 0, 1, and 2. For more information about the .NET GC and generational garbage collection, see the [.NET garbage collection guide](../../standard/garbage-collection/fundamentals.md#generations).
55
55
@@ -83,7 +83,7 @@ Available starting in: .NET 9.0.
|`dotnet.gc.heap.generation`| string | Name of the garbage collector managed heap generation. |`gen0`; `gen1`; `gen2`;`loh`;`poh`| Always |
86
+
|`gc.heap.generation`| string | Name of the garbage collector managed heap generation. |`gen0`; `gen1`; `gen2`;`loh`;`poh`| Always |
87
87
88
88
The .NET GC divides the heap into generations. In addition to the standard numbered generations, the GC also puts some objects into two special generations:
89
89
@@ -100,6 +100,10 @@ Available starting in: .NET 9.0.
|`gc.heap.generation`| string | Name of the garbage collector managed heap generation. |`gen0`; `gen1`; `gen2`; `loh`; `poh`| Always |
106
+
103
107
This metric reports the same values as calling <xref:System.GCGenerationInfo.FragmentationAfterBytes?displayProperty=nameWithType>.
104
108
105
109
When .NET objects are allocated, initially they tend to be laid out contiguously in memory. However, if some of those objects are later collected by the GC, this creates gaps of unused memory between the live objects that remain. These gaps represent the portion of the GC heap that's not currently being used to store objects, often called "fragmentation." The GC can reuse the fragmentation bytes in the future for new object allocations if the object size is small enough to fit in one of the gaps. The GC can also perform a special compacting garbage collection that moves remaining live objects next to each other as long as the objects haven't been pinned in place.
0 commit comments