Provides a set of APIs that can be used to retrieve garbage collection information.
public value class GCMemoryInfo
public struct GCMemoryInfo
type GCMemoryInfo = struct
Public Structure GCMemoryInfo
A GC is identified by its Index. which starts from 1 and increases with each GC (see more explanation of it in the Index prooperty). If you are asking for a GC that does not exist, eg, you called the GC.GetGCMemoryInfo API before a GC happened, or you are asking for a GC of GCKind.FullBlocking and no full blocking GCs have happened, you will get all 0's in the info, including the Index. So you can use Index 0 to detect that no GCs, or no GCs of the kind you specified have happened.
Specifies if this is a compacting GC or not.
Specifies if this is a concurrent GC (BGC) or not.
Gets the number of objects ready for finalization this GC observed.
Gets the total fragmentation when the last garbage collection occurred.
Gets the generation this GC collected. Collecting a generation means all its younger generation(s) are also collected.
Gets the generation information for all generations.
Gets the total heap size when the last garbage collection occurred.
Gets the high memory load threshold when the last garbage collection occurred.
The index of this GC. GC indices start with 1 and get increased at the beginning of a GC. Since the information is updated at the end of a GC, this means you can get the information for a BGC with a smaller index than a foreground GC finished earlier.
Gets the memory load when the last garbage collection occurred.
Gets the pause durations. For blocking GCs there's only 1 pause; for BGC there are 2.
Gets the pause time percentage in the GC so far.
Gets the number of pinned objects this GC observed.
Gets the promoted bytes for this GC.
Gets the total available memory for the garbage collector to use when the last garbage collection occurred.
Gets the total committed bytes of the managed heap.