Tricolor GC in Go: How the Marker Keeps Live Objects Alive — and What Happens Without the Write Barrier
Tricolor marking is not a garbage collection algorithm so much as a coexistence protocol between the collector and a program that keeps rewriting the object graph mid-traversal. I walk through the invariant, the write barrier (including Go’s hybrid barrier from 1.8), allocate-black and mark assist — and hand you an interactive sandbox where you can switch the barrier off and watch the GC free a live object.