GC
Module | ejs.sys |
Definition | class GC |
Inheritance | GC ![]() |
Specified | ejscript-1.1 |
Stability | Evolving. |
Garbage collector control class.
Singleton class to control operation of the Ejscript garbage collector.
Properties
Qualifiers | Property | Type | Description |
---|---|---|---|
public static get set | enabled | Boolean | Is the garbage collector is enabled. Enabled by default. |
public static get set | workQuota | Number | The 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 Methods
Qualifiers | Method |
---|---|
public static | run(deep: Boolean = false): Void |
Run the garbage collector and reclaim memory allocated to objects and properties that are no longer reachable. |
Method Detail
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 enable property is set to false.
- Parameters
deep: Boolean If set to true, will collect from all generations. The default is to collect only the youngest geneartion of objects. [default: false]