GC
Module | ejs.sys |
Namespace | "ejs.sys" |
Definition | class GC |
Specified | Ejs-11. |
Inheritance | GC ![]() |
Garbage collector control class.
Singleton class to control operation of the Ejscript garbage collector.
Properties
Qualifiers | Property | Type | Description |
---|---|---|---|
No properties defined |
GC Methods
Qualifiers | Method |
---|---|
public static get | allocatedMemory(): Number |
public static get | enabled(): Boolean |
Test if the garbage collector is enabled. | |
public static set | enabled(on: Boolean): Void |
Enable or disable the garbage collector. | |
public static get | maxMemory(): Number |
public static set | maxMemory(limit: Number): Void |
public static get | peakMemory(): Number |
public static | printStats(): Void |
public static | run(deep: Boolean): Void |
Run the garbage collector and reclaim memory allocated to objects and properties that are no longer reachable. | |
public static get | workQuota(): Number |
Get the quota of work to perform before the GC will be invoked. | |
public static set | workQuota(quota: Number): Void |
Set the quota of work to perform before the GC will be invoked. |
Method Detail
static get public allocatedMemory(): Number
static get public enabled(): Boolean
Test if the garbage collector is enabled.
- Returns
- True if enabled the garbage collector. The default value is true.
Enable or disable the garbage collector.
- Parameters
on: Boolean Set to true to enable the collector.
static get public maxMemory(): Number
static get public peakMemory(): Number
static public printStats(): Void
Run the garbage collector and reclaim memory allocated to objects and properties that are no longer reachable.
- Description
- When objects and properties are freed, any registered destructors will be called. The run function will run the garbage collector even if the.
- Parameters
deep: Boolean If set to true, will collect from all generations. The default is to collect only the youngest geneartion of objects. [default: flase]
static get public workQuota(): Number
Get the quota of work to perform before the GC will be invoked.
- Returns
- The number of work units that will trigger the GC to run. This roughly corresponds to the number of allocated objects.
Set the quota of work to perform before the GC will be invoked.
- Parameters
quota: Number The number of work units that will trigger the GC to run. This roughly corresponds to the number of allocated objects.