July 28, 2014
Specifies the behavior for a forced garbage collection.
public enum GCCollectionMode
|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.
Windows Phone OS
Supported in: 8.1, 8.0