GCLatencyMode Enumeration
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Adjusts the time that the garbage collector intrudes in your application.
Assembly: mscorlib (in mscorlib.dll)
| Member name | Description | |
|---|---|---|
| Batch | Disables garbage collection concurrency and reclaims objects in a batch call. This is the most intrusive mode. This mode is designed for maximum throughput at the expense of responsiveness. This mode overrides the [503f55ba-26ed-45ac-a2ea-caf994da04cd] runtime configuration setting. If [503f55ba-26ed-45ac-a2ea-caf994da04cd] is enabled, switching to Batch mode prevents any further concurrent collections. | |
| Interactive | Enables garbage collection concurrency and reclaims objects while the application is running. This is the default mode for garbage collection on a workstation and is less intrusive than Batch. It balances responsiveness with throughput. This mode is equivalent to garbage collection on a workstation that is concurrent. | |
| LowLatency | Enables garbage collection that is more conservative in reclaiming objects. Full collections occur only if the system is under memory pressure, whereas generation 0 and generation 1 collections might occur more frequently This mode is not available for the server garbage collector. | |
| SustainedLowLatency | Enables garbage collection that tries to minimize latency over an extended period. The collector tries to perform only generation 0, generation 1, and concurrent generation 2 collections. Full blocking collections may still occur if the system is under memory pressure. |
You can adjust the intrusiveness of garbage collection in your application by setting the LatencyMode property to one of the enumeration values.
See [96278bb7-6eab-4612-8594-ceebfc887d81] for a discussion of how the runtime configuration settings for garbage collection affect the default value for this enumeration.