Skip to content

Commit 46c474b

Browse files
authored
Make "Built in Metrics for Runtime" doc accurate for memory metrics (#44616)
1 parent 295b148 commit 46c474b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/core/diagnostics/built-in-metrics-runtime.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Available starting in: .NET 9.0.
4949

5050
| Attribute | Type | Description | Examples | Presence |
5151
|---|---|---|---|---|
52-
| `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 |
5353

5454
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).
5555

@@ -83,7 +83,7 @@ Available starting in: .NET 9.0.
8383

8484
| Attribute | Type | Description | Examples | Presence |
8585
|---|---|---|---|---|
86-
| `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 |
8787

8888
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:
8989

@@ -100,6 +100,10 @@ Available starting in: .NET 9.0.
100100
| -------- | --------------- | ----------- | -------------- |
101101
| `dotnet.gc.last_collection.heap.fragmentation.size` | UpDownCounter | `By` | The heap fragmentation, as observed during the latest garbage collection. |
102102

103+
| Attribute | Type | Description | Examples | Presence |
104+
|---|---|---|---|---|
105+
| `gc.heap.generation` | string | Name of the garbage collector managed heap generation. | `gen0`; `gen1`; `gen2`; `loh`; `poh` | Always |
106+
103107
This metric reports the same values as calling <xref:System.GCGenerationInfo.FragmentationAfterBytes?displayProperty=nameWithType>.
104108

105109
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

Comments
 (0)