Brussels / 2 & 3 February 2019


Tuning Go GC Parameters

The Go runtime has a garbage collector (GC) which is famously simple and lacking in tuning parameters compared to, say, a JVM.

However there are controls, and in this talk we shall look at what they do and when you might use them. We will also look at how to understand what GC is doing and how much that work might be costing your program.

Primarily we will look at the GOGC environment variable, and how it can be used to increase or decrease the rate of garbage collection, or turn it off completely.

We will show how garbage-collection activity can be observed via metrics, e.g. using Prometheus, or in more low-level detail via the GODEBUG environment variable.

We will also look at the evolution of GC performance in Go over the last five years, and new controls being added in the next version of Go.


Photo of Bryan Boreham Bryan Boreham