GC

Moduleejs
Definition class GC
InheritanceGC inherit Object
Specifiedejscript-2.5
StabilityEvolving.

Garbage collector control class.

Singleton class to control operation of the Ejscript garbage collector.


Properties

QualifiersPropertyTypeDescription
static get set enabledBooleanIs the garbage collector is enabled. Enabled by default.
static get set newQuotaNumberThe quota of work to perform before the GC will be invoked. Set to the number of work units that will trigger the GC to run. This roughly corresponds to the number of allocated objects.

GC Class Methods

QualifiersMethod
static run(): Void
 Run the garbage collector and reclaim memory allocated to objects and properties that are no longer reachable.

GC Instance Methods

(No own instance methods defined)

QualifiersMethod

Method Detail

static run(): Void
Description
Run the garbage collector and reclaim memory allocated to objects and properties that are no longer reachable. When objects and properties are freed, any registered native destructors will be called. The run function will run the garbage collector even if the enable property is set to false. It is normally not required to manually call the run method as the ejs virtual machine runtime will automatically run the garbage collector as required.