Systems Engineer

Go Garbage Collector – Built from Scratch

GoSystems ProgrammingMemory ManagementData Structures

About

A mark-and-sweep garbage collector implemented in Go from scratch. Built to deeply understand how memory management works under the hood — heap allocation, object graphs, reachability analysis, and GC pause times.

What I Built

  1. Implemented mark-and-sweep in two phases: DFS traversal to mark live objects, then sweep to reclaim unreachable memory

  2. Learned how GC pause times emerge and why generational GC exists as an optimization

  3. Deep understanding of heap layout, pointer chasing, and why Go uses a tricolor marking algorithm in production

VA
Vishal
Aggarwal

Full Stack Developer

Ask about Vishal ✦