GCSettings::LargeObjectHeapCompactionMode Property
[This topic is preliminary and is subject to change.]
Gets or sets a value that indicates whether a full blocking garbage collection compacts the large object heap (LOH).
Namespace: System.Runtime
Assembly: mscorlib (in mscorlib.dll)
public: static property GCLargeObjectHeapCompactionMode LargeObjectHeapCompactionMode { GCLargeObjectHeapCompactionMode get (); void set (GCLargeObjectHeapCompactionMode value); }
Property Value
Type: System.Runtime::GCLargeObjectHeapCompactionModeOne of the enumeration values that indicates whether a full blocking garbage collection compacts the LOH.
The default value of the LargeObjectHeapCompactionMode property is GCLargeObjectHeapCompactionMode::Default, which indicates that the LOH is not compacted during garbage collections. If you assign the property a value of GCLargeObjectHeapCompactionMode::CompactOnce, the LOH is compacted during the next blocking garbage collection, and the property value is reset to GCLargeObjectHeapCompactionMode::Default.
If the LargeObjectHeapCompactionMode property is set to GCLargeObjectHeapCompactionMode::Default, the next full blocking garbage collection (and compaction of the LOH) occurs at an indeterminate future time. You can compact the LOH immediately by using code like the following:
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.