JavaScript frees memory by reachability, not reference
counting. Allocate objects, wire references, spawn an unreachable
cycle with Create garbage, then run
Mark (walk from the roots) and Sweep
(collect the unmarked). Toggle the generational heap to watch survivors
climb Eden → Survivor → Tenured.
→
Root — global / stack frame. Reachability starts here.
Object — unmarked. Liveness unknown until GC traverses.
Marked live — reached from a root (shows a ✓).