.NET Framework 4.6 and 4.5
Specifies the behavior for a forced garbage collection.
|Default||The default setting for this enumeration, which is currently 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. |
Use the GC.Collect method overload to specify the GCCollectionMode value.
The following example forces a garbage collection for generation 2 objects with the Optimized setting.
No code example is currently available or this language may not be supported.
Supported in: 4.6, 4.5, 4, 3.5 SP1, 3.0 SP1, 2.0 SP1
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Portable Class Library
Supported in: Portable Class Library
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8