GCMemoryInfo Struct
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a set of APIs that can be used to retrieve garbage collection information.
public value class GCMemoryInfo
public readonly struct GCMemoryInfo
type GCMemoryInfo = struct
Public Structure GCMemoryInfo
- Inheritance
A garbage collection (GC) is identified by its Index, which starts from 1 and increases with each GC. If you ask for a GC that doesn't exist, you'll get all 0's in the info, including the Index. For example, you'll get 0's if you call the GetGCMemoryInfo method before a GC has happened, or you ask for a GC of GCKind.FullBlocking and no full blocking GCs have happened. You can use index 0 to detect that no GCs, or no GCs of the kind you specified, have occurred.
Compacted |
Gets a value that indicates if this is a compacting GC or not. |
Concurrent |
Gets a value that indicates if this is a concurrent GC (background GC) or not. |
Finalization |
Gets the number of objects that are ready for finalization that this GC observed. |
Fragmented |
Gets the total fragmentation when the last garbage collection occurred. |
Generation |
Gets the generation this GC collected. Collecting a generation also collects younger generations. |
Generation |
Gets the generation information for all generations. |
Heap |
Gets the total heap size when the last garbage collection occurred. |
High |
Gets the high memory load threshold when the last garbage collection occurred. |
Index |
Gets the index of this GC. |
Memory |
Gets the physical memory load when the last garbage collection occurred. |
Pause |
Gets the durations of the pauses when all managed threads are suspended. |
Pause |
Gets the pause time percentage in the GC so far. If the pause time is 1.2%, this property's value is 1.2. The value is calculated by taking the sum of all GC pauses so far and dividing that by the total elapsed time of the process since the runtime was loaded. This running counter is updated at the end of each GC. It does not distinguish between GCKind. That is, at every GC, the calculated value is updated, and when you access this property, it gets the latest calculated value. |
Pinned |
Gets the number of pinned objects this GC observed. |
Promoted |
Gets the promoted bytes for this GC. |
Total |
Gets the total available memory for the garbage collector to use when the last garbage collection occurred. |
Total |
Gets the total committed bytes of the managed heap. |
Produto | Versões |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: