Class GCExtensions
Represents a collection of GC notifications.
Inherited Members
Namespace: DotNext.Runtime
Assembly: DotNext.dll
Syntax
public static class GCExtensions
Methods
View SourceWhenCompactionOccurred()
Creates a filter that allows to detect heap compaction.
Declaration
public static GCNotification WhenCompactionOccurred()
Returns
| Type | Description |
|---|---|
| GCNotification | A new filter. |
WhenHeapFragmented(double)
Creates a filter that allows to detect managed heap fragmentation threshold.
Declaration
public static GCNotification WhenHeapFragmented(double threshold)
Parameters
| Type | Name | Description |
|---|---|---|
| double | threshold | The memory threshold. The memory threshold; must be in range (0, 1]. |
Returns
| Type | Description |
|---|---|
| GCNotification | A new filter. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
|
WhenMemoryPressure(double)
Creates a filter that allows to detect managed heap occupation.
Declaration
public static GCNotification WhenMemoryPressure(double threshold)
Parameters
| Type | Name | Description |
|---|---|---|
| double | threshold | The memory threshold. The memory threshold; must be in range (0, 1]. |
Returns
| Type | Description |
|---|---|
| GCNotification | A new filter. |
Remarks
This filter allows to detect a specific ratio between MemoryLoadBytes and HighMemoryLoadThresholdBytes.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
|
WhenTriggered()
Creates a filter that triggers notification on every GC occurred.
Declaration
public static GCNotification WhenTriggered()
Returns
| Type | Description |
|---|---|
| GCNotification | A new filter. |
WhenTriggered(int)
Creates a filter that allows to detect garbage collection of the specified generation.
Declaration
public static GCNotification WhenTriggered(int generation)
Parameters
| Type | Name | Description |
|---|---|---|
| int | generation | The expected generation. |
Returns
| Type | Description |
|---|---|
| GCNotification | A new filter. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
|