Hands-On System Programming with Go
上QQ阅读APP看书,第一时间看更新

The history of GC in Go

The GC is responsible for freeing the areas of the heap that are not referenced in any stack. This was originally written in C and had a stop the world behavior. The program stopped for a fraction of time, freed the memory, and then resumed its flow.

Go 1.4 started the process of converting the runtime, including the garbage collector, into Go. Translating these parts in Go lays the foundations for easier optimization that already begun with version 1.5, where the GC became much faster and could run concurrently with other goroutines.

From that point on, there has been a lot of optimization and improvement of the process, which managed to reduce the GC time by several orders of magnitude.