This documentation is archived and is not being maintained.
GCCollectionMode Enumeration
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Specifies the behavior for a forced garbage collection.
Namespace:
System
Assembly:
mscorlib (in mscorlib.dll)
No code example is currently available or this language may not be supported.
| Member name | Description |
|---|
| 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