Mark and Sweep GC
The lesson walks through the mark-and-sweep algorithm step by step using an array-of-strings heap layout: the mark phase identifies all live objects, the sweep phase removes de-referenced objects, and heap compaction closes the resulting memory holes to prevent Swiss-cheese fragmentation.
Previous Module
Array Performance Optimizations
This Module
The .NET Garbage Collector