GCSettings.LatencyMode Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the current latency mode for garbage collection.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Runtime.GCLatencyModeOne of the enumeration values that specifies the latency mode.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | GCLatencyMode is set to an invalid value. |
You can reduce the level of intrusiveness of garbage collection in your application by setting the GCLatencyMode to LowLatency during critical operations. After such operations are completed, return to a higher latency mode so that more objects can be reclaimed to increase memory.
See [96278bb7-6eab-4612-8594-ceebfc887d81] for a discussion of how the runtime configuration settings for garbage collection affect the default value of the GCLatencyMode enumeration.
- SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.