Show / Hide Table of Contents

Class GCExtensions

Represents a collection of GC notifications.

Inheritance
object
GCExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Runtime
Assembly: DotNext.dll
Syntax
public static class GCExtensions

Methods

View Source

WhenCompactionOccurred()

Creates a filter that allows to detect heap compaction.

Declaration
public static GCNotification WhenCompactionOccurred()
Returns
Type Description
GCNotification

A new filter.

View Source

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

threshold is invalid.

View Source

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

threshold is invalid.

View Source

WhenTriggered()

Creates a filter that triggers notification on every GC occurred.

Declaration
public static GCNotification WhenTriggered()
Returns
Type Description
GCNotification

A new filter.

View Source

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

generation is less than 0 or greater than MaxGeneration.

  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾