GCNotificationStatus Enumeration


Provides information about the current registration for notification of the next full garbage collection.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

type GCNotificationStatus

Member nameDescription

The current registration was canceled by the user.


The notification failed for any reason.


This result can be caused by the following: there is no current registration for a garbage collection notification, concurrent garbage collection is enabled, or the time specified for the millisecondsTimeout parameter has expired and no garbage collection notification was obtained. (See the <gcConcurrent> runtime setting for information about how to disable concurrent garbage collection.)


The notification was successful and the registration was not canceled.


The time specified by the millisecondsTimeout parameter for either GC.WaitForFullGCApproach(Int32) or GC.WaitForFullGCComplete(Int32) has elapsed.

Use the RegisterForFullGCNotification method to register for a full garbage collection notification. Then use the WaitForFullGCApproach method or the WaitForFullGCComplete method to return a GCNotificationStatus enumeration that contains the status of the notification.

The following example obtains a GCNotificationStatus enumeration from the WaitForFullGCApproach method. If the enumeration returns Succeeded, it calls the custom method OnFullGCApproachNotify to perform actions in response to the approaching full garbage collection. This code example is part of a larger example provided for Garbage Collection Notifications topic.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top