Home /Modules/vm/GC.md

GC.md

lib/vm/GC.md · 50 line(s) · markdown

SLeeLa Garbage Collection

SLeeLa uses one common managed-memory contract for SLVM/1 through SLVM/11.

Collector

The native collector is a stable-handle, non-moving, generational incremental tracing collector:

The design intentionally does not relocate objects. Current SLeeLa values expose VM-local handles, so stable handles avoid pointer relocation while still providing generational and incremental collection.

Modern production collectors use the same broad concepts: generational allocation, incremental work, remembered sets, safepoints, and SATB-style barriers. Java HotSpot G1 is explicitly generational and incremental and uses remembered sets and SATB marking; LLVM documents safepoints and barriers as compiler/runtime contracts.

Native and C++ layers

SLeeLa source model

These classes describe the GC object model and policy surface. They do not create a second collector.

Threading boundary

The current Core VM performs heap reclamation at a quiescent VM safepoint when worker threads are not active. Active worker-thread execution is allowed to continue under the structured-concurrency contract and collection is deferred until a safe quiescence point. This is deliberate: accurate root scanning requires all managed execution stacks to be observable at a GC safepoint.

Native sockets, files, pipes, mutexes, threads, libraries, and other OS resources are never reclaimed merely because an object becomes unreachable. Their lifecycle remains governed by runtime resource ownership and teardown.

Quality / permutation

GCQuality and GCPermutation provide descriptive source-level policy dimensions for latency, throughput, memory pressure, generation, barriers, roots, resources, and relocation. They are intended for compiler/runtime planning and diagnostics, not for silently changing the collector semantics of an existing VM generation.