Garbage Collector Internals
Tri-color mark-sweep, GOGC, and GC pauses
Tri-color mark-and-sweep
Go's GC uses a concurrent tri-color mark-and-sweep algorithm. Objects are white (unvisited), grey (found but children unscanned), or black (fully scanned). White objects are garbage at sweep.
Concurrent GC
The Go GC runs mostly concurrently with application goroutines. This reduces stop-the-world (STW) pauses to sub-millisecond durations in most programs.