System.GCCollectionMode Enumeration

Specifies the behavior for a forced garbage collection.

Syntax

public enum GCCollectionMode

Remarks

Use the GC.Collect(int, GCCollectionMode) method overload to specify the GCCollectionMode value.

Members

Member NameDescription
Default

The default setting for this enumeration, which is currently GCCollectionMode.Forced.

Forced

Forces the garbage collection to occur immediately.

Optimized

Allows the garbage collector to determine whether the current time is optimal to reclaim objects.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0