Returns the status of a registered notification for determining whether a full, blocking garbage collection by the common language runtime has completed.
![]()
The status of the registered garbage collection notification.
Use the GCNotificationStatus enumeration returned by this method to determine the status of the current garbage collection notification that was registered by using the GC.RegisterForFullGCNotification(int, int) method. You can also use the GC.WaitForFullGCApproach method to determine whether a full garbage collection is imminent.
When the enumeration returns GCNotificationStatus.Succeeded, you can do tasks such as resuming work and obtaining a collection count with the GC.CollectionCount(int) property.
This method waits indefinitely for a garbage collection notification to be obtained. If you want to specify a time-out period for the method to return if the notification cannot be obtained, use the GC.WaitForFullGCApproach(int) method overload. If you call this method without specifying a time-out, you can call the GC.CancelFullGCNotification method if you are waiting longer than preferred.
This method call should be preceded with a call to the erload:System.GC.WaitForFullGCApproach method to make sure that you have had a full garbage collection. Calling this method alone can produce indeterminate results.