On this page:
gc
minor_  gc
incremental_  gc
current_  use
cumulative_  use
8.17.0.6

17.1 Memory Management🔗ℹ

 import: rhombus/memory package: rhombus-lib

function

fun memory.gc() :: Void

 

function

fun memory.minor_gc() :: Void

 

function

fun memory.incremental_gc() :: Void

Forces an immediate garbage collection:

  • memory.gc forces a major collection that inspects all generations.

  • memory.minor_gc function forces only a minor collection.

  • memory.incremental_gc function may perform a minor collection, but also requests incremental collection for future automatic collections. The request expires if it is not renewed frequently.

function

fun memory.current_use() :: Int

 

function

fun memory.cumulative_use() :: Int

Returns the amount of memory allocated:

  • memory.current_use reports the number of bytes occupied by all currently allocated objects, not counting overhead, but including objects that might be reclaimed immediately by a garbage collection.

  • memory.cumulative_use reports the total number of bytes that have been allocated since the process started, including bytes that have been subsequently reclaimed by garbage collection.