GC

Moduleejs.sys
Namespace"ejs.sys"
Definition class GC
SpecifiedEjs-11.
InheritanceGC inherit Object

Garbage collector control class.

Singleton class to control operation of the Ejscript garbage collector.


Properties

QualifiersPropertyTypeDescription
No properties defined

GC Methods

QualifiersMethod
public get allocatedMemory(): Number
public get enabled(): Boolean
 Test if the garbage collector is enabled.
public set enabled(on: Boolean): Void
 Enable or disable the garbage collector.
public get maxMemory(): Number
public set maxMemory(limit: Number): Void
public 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 get workQuota(): Number
 Get the quota of work to perform before the GC will be invoked.
public set workQuota(quota: Number): Void
 Set the quota of work to perform before the GC will be invoked.

Method Detail

get public allocatedMemory(): Number

get public enabled(): Boolean

Test if the garbage collector is enabled.

Returns
True if enabled the garbage collector. The default value is true.

set public enabled(on: Boolean): Void

Enable or disable the garbage collector.

Parameters
on: Boolean Set to true to enable the collector.

get public maxMemory(): Number

set public maxMemory(limit: Number): Void

get public peakMemory(): Number

static public printStats(): Void

static public run(deep: Boolean): 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]

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 public workQuota(quota: Number): Void

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.

Embedthis Software LLC, 2003-2009. All rights reserved. Embedthis is a trademark of Embedthis Software LLC.