Member-only story
Go 1.20 Experiment: Memory Arenas vs. Traditional Memory Management
A dive into Go’s new experimental feature

Note: Go arenas are an experimental feature. The API and implementation is completely unsupported and the Go team makes no guarantees about compatibility or whether it will even continue to exist in any future release.
See this GitHub discussion for more details.
Introduction
Go 1.20 introduces an experimental concept of “arenas” for memory management, which can be used to improve the performance of your Go programs. In this blog post, we’ll take a look at:
- What are arenas
- How do they work
- How can you determine if your programs could benefit from using arenas
- How we used arenas to optimize one of our services
What Are Memory Arenas?
Go is a programming language that utilizes garbage collection, meaning that the runtime automatically manages memory allocation and deallocation for the programmer. This eliminates the need for manual memory management, but it comes with a cost:
The Go runtime must keep track of every object that is allocated, leading to increased performance overhead.