GarbageCollector

class in UnityEngine.Scripting

Switch to Manual

Description

API to control the garbage collector on the Mono and IL2CPP scripting backends.

See GarbageCollector.GCMode for how to change the global garbage collector operation mode.

Static Variables

GCModeSet and get global garbage collector operation mode.
incrementalTimeSliceNanosecondsThe target duration of a collection step when performing incremental garbage collection.
isIncrementalReports whether incremental garbage collection is enabled.

Static Functions

CollectIncrementalPerform incremental garbage collection for the duration specified by the nanoseconds parameter.

Events

GCModeChangedSubscribe to this event to get notified when GarbageCollector.GCMode changes.