Mark-and-Sweep Garbage Collection
Flowcharts & Algorithms diagram · made in Skemio

What it shows
- Roots (stack variables, globals) serve as the starting point for graph traversal.
- Mark phase flags reachable memory; unreachable islands remain unflagged.
- Sweep phase reclaims unflagged blocks into a free-list without extra allocations.
The takeaway
Reachability from root references—not reference counts—determines object survival.
- #ComputerScience
- #MemoryManagement
- #Algorithms
- #GarbageCollection
- #Runtimes
- #SoftwareEngineering





