Table of Contents

Class GC

Namespace
nanoFramework.Runtime.Native
Assembly
nanoFramework.Runtime.Native.dll

Provides a set of methods and properties for interacting with the garbage collector.

public static class GC
Inheritance
GC
Inherited Members

Methods

EnableGCMessages(bool)

Enables or disables the output of garbage collection messages.

public static void EnableGCMessages(bool enable)

Parameters

enable bool

true to enable the output of GC messages; otherwise, false.

Remarks

Enabling GC messages may not always result in output, depending on the target build options. For example, RTM builds, which remove all non-essential features, may not output these messages.

Run(bool)

Forces an immediate garbage collection of all generations.

public static uint Run(bool compactHeap)

Parameters

compactHeap bool

true to force heap compaction; otherwise, false.

Returns

uint

The amount of free memory, in bytes, after the garbage collection.