Golang's Garbage

Wednesday, May 24, 2017 - 9:55am10:50am

Andrey Sibiryov, Uber


In the first part of this talk, we’ll chat about the design of Golang’s Garbage Collector (GC) and the theory behind modern garbage collection in general. We’ll go over common GC traits, such as whether a given GC is exact, generational, compacting and so on, try to figure out each trait’s upsides and downsides and how they relate to the current and future Golang’s GC designs.

In the second part, I’ll use a particular in-memory database project as an example to demonstrate some easy and some quite complicated tricks on memory management aimed at overcoming certain design shortcomings and trade-offs made in Golang’s GC. We’ll chat about the ubiquity and the cost of pointers, the runtime optimizations out there that might help reduce the pointer burden (like pointerless maps and channels, and uintptr-based weak pointers), about object pooling and how sync.Pool is a very different animal from your common channel-based pools.

In the third and final part, we’ll hit the rock bottom and chat about some dark magic with native heap allocations and alternative unsafe heaps.

Andrey Sibiryov, Uber

Andrey Sibiryov is an SRE at Uber, New York City. He is mostly focusing on infrastructure monitoring, observability & performance. Some of you might know Andrey through his open-source projects:

  • Gorb: In-kernel load balancer. Based on IPVS, the same technology that powers the Docker Swarm routing mesh.
  • Tesson: NUMA-aware application sharding tool.

Previously, Andrey led the Cloud Technologies department at Yandex where he built the Cocaine Cloud Platform, and worked on Helios, a Docker-based CI/CD stack at Spotify.

Open Access Media

USENIX is committed to Open Access to the research presented at our events. Papers and proceedings are freely available to everyone once the event begins. Any video, audio, and/or slides that are posted after the event are also free and open to everyone. Support USENIX and our commitment to Open Access.

@conference {202783,
author = {Andrey Sibiryov},
title = {Golang{\textquoteright}s Garbage},
year = {2017},
publisher = {USENIX Association},
month = may,

Presentation Video 

Presentation Audio