GarbageCollection enum

Inheritance
Available extensions

Values

stop → const GarbageCollection

Stops the garbage collector.

restart → const GarbageCollection

Restarts the garbage collector.

collect → const GarbageCollection

Performs a full garbage-collection cycle.

count → const GarbageCollection

Current amount of memory (in Kbytes) in use by Lua.

countBytes → const GarbageCollection

Remainder of dividing the current amount of bytes of memory in use by Lua by 1024.

isRunning → const GarbageCollection

Return 1 if GC is active (not stopped); note that GC may not be actively collecting even if it's running

step → const GarbageCollection

Perform an explicit GC step, with the step size specified in KB. Garbage collection is handled by 'assists' that perform some amount of GC work matching pace of allocation explicit GC steps allow to perform some amount of work at custom points to offset the need for GC assists note that GC might also be paused for some duration (until bytes allocated meet the threshold) if an explicit step is performed during this pause, it will trigger the start of the next collection cycle

setGoal → const GarbageCollection

tune GC parameters G (goal), S (step multiplier) and step size (usually best left ignored)

garbage collection is incremental and tries to maintain the heap size to balance memory and performance overhead this overhead is determined by G (goal) which is the ratio between total heap size and the amount of live data in it G is specified in percentages; by default G=200% which means that the heap is allowed to grow to ~2x the size of live data.

collector tries to collect S% of allocated bytes by interrupting the application after step size bytes were allocated. when S is too small, collector may not be able to catch up and the effective goal that can be reached will be larger. S is specified in percentages; by default S=200% which means that collector will run at ~2x the pace of allocations.

it is recommended to set S in the interval 100 / (G - 100), 100 + 100 / (G - 100)) with a minimum value of 150%; for example:

  • for G=200%, S should be in the interval 150%, 200%
  • for G=150%, S should be in the interval 200%, 300%
  • for G=125%, S should be in the interval 400%, 500%
setStepMul → const GarbageCollection
setStepSize → const GarbageCollection

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<GarbageCollection>
A constant List of the values in this enum, in order of their declaration.