GarbageCollector

class in UnityEngine.Scripting

/

Implemented in:UnityEngine.CoreModule

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 Properties

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 Methods

CollectIncrementalPerform an on-demand incremental garbage collection for a maximum duration specified by the nanoseconds parameter.

Events

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

Did you find this page useful? Please give it a rating: