Support for script-based garbage collection strategies.
Object GC
Properties | |
items | Single GC sensible items currently allocated. |
th_active | Threshold of occupied memory above which the GC will enter the active mode. |
th_normal | Threshold of occupied memory above which the GC will enter the normal mode. |
usedMem | Memory used by the Falcon engine. |
Methods | |
adjust | Sets or gets the automatic threshold levels adjust algorithm. |
enable | Turns automatic GC feature on or off. |
perform | Requests immediate check of garbage. |
Single GC sensible items currently allocated.
Single GC sensible items currently allocated.
Threshold of occupied memory above which the GC will enter the active mode.
Threshold of occupied memory above which the GC will enter the active mode.
Threshold of occupied memory above which the GC will enter the normal mode.
Threshold of occupied memory above which the GC will enter the normal mode.
Memory used by the Falcon engine.
Memory used by the Falcon engine.
Sets or gets the automatic threshold levels adjust algorithm.
GC.adjust( [mode] )
mode | The adjust mode used by the GC. |
Return | The mode currently set. |
Mode can be one of:
Turns automatic GC feature on or off.
GC.enable( mode )
mode | true to turn automatic GC on, false to turn it off. |
Virtual machines and some heavy garbage generating functions call periodically a function that checks for the level of allocated memory to have reached a critical point. When there is too much allocated memory of uncertain status, a garbage collecting loop is started.
By setting this property to false, this automatic control is skipped, and allocated memory can grow up to physical process limits (or VM memory limit constraints, if provided). Setting this value to true will cause VM to perform memory control checks again with the usual strategy.
In case the script is sure to have generated a wide amount of garbage, it is advisable to call explicitly GC.perform() before turning automatic GC on, as the "natural" collection loop may start at any later moment, also after several VM loops.
Requests immediate check of garbage.
GC.perform( [wcoll] )
wcoll | Set to true to wait for the collection of free memory to be complete. |
Return | true if the gc has been actually performed, false otherwise. |
Suspends the activity of the calling Virtual Machine, waiting for the garbage collector to complete a scan loop before proceeding.
See also: About the garbage collector..