Grow an object graph, trace it from pinned roots, sweep unreachable cycles, then compact the survivors and watch every stale pointer get rewritten.
Collector stateReady to traceCycle / leak lab · seed 357
Live bytes0 Breachable from rootsGarbage bytes0 Bcurrently unreachableReclaimed bytes0 Bthis collectionFragmentation0%external · 1 free runPause time0.0 msdeterministic STW modelHeap used0 B384 B free
Living heap
Mutator
Roots
Mark
Sweep
Compact
ReachableUnreachableMark frontierRelocated / stale pointer
Select a pod in the graph or object list. Pointer labels show the stored byte address; amber labels are stale until the compacting collector rewrites them.
Collector comparison
Mark–sweep
Trace from roots, free white objects, keep every survivor at the same address. Fast pointer handling; holes remain.
Projecting…
Copy / compact
Relocate survivors into a dense prefix and rewrite roots and fields. Allocation becomes a bump; addresses change.
Projecting…
This runnable relocation path is mark-compact: it marks, sweeps, then slides. A semispace copying collector traces directly into to-space instead; both relocate survivors and must rewrite pointers, but copying reserves extra space.