GC.CancelFullGCNotification Method

Definition

Cancels the registration of a garbage collection notification.

public static void CancelFullGCNotification ();
[System.Security.SecurityCritical]
public static void CancelFullGCNotification ();
Attributes

Exceptions

This member is not available when concurrent garbage collection is enabled. See the <gcConcurrent> runtime setting for information about how to disable concurrent garbage collection.

Examples

The following example cancels a garbage collection registration. This example is part of a larger example provided for the Garbage Collection Notifications topic.

finalExit = true;
checkForNotify = false;
GC.CancelFullGCNotification();

Remarks

This method cancels a garbage collection notification that was registered by using the RegisterForFullGCNotification method. You do not have to call this method before adjusting threshold parameter values in subsequent calls to the RegisterForFullGCNotification method.

Applies to

Prodotto Versioni
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also