GCNotificationStatus Enumeration
Provides information about the current registration for notification of the next full garbage collection.
Assembly: mscorlib (in mscorlib.dll)
| Member name | Description | |
|---|---|---|
| Succeeded | The notification was successful and the registration was not canceled. | |
| Failed | The notification failed for any reason. | |
| Canceled | The current registration was canceled by the user. | |
| Timeout | The time specified by the millisecondsTimeout parameter for either GC.WaitForFullGCApproach(Int32) or GC.WaitForFullGCComplete(Int32) has elapsed. | |
| NotApplicable | 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.) |
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.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.