Get the latest tech news

Understanding the Go Runtime: The Garbage Collector


In the previous article we explored the Go scheduler — how goroutines get multiplexed onto OS threads, the GMP model, and all the tricks the runtime uses to keep your cores busy. But there’s a fundamental problem we haven’t addressed yet: all those goroutines allocate memory, and somebody has to clean it up. That’s the garbage collector’s job, and that’s what we’re exploring today. In this article we’ll be looking at the garbage collector as it works in Go 1.26, which introduced the GreenTea GC. If you’re using an earlier version of Go, don’t worry — the overall structure is the same. The main difference is in the mark phase, and we’ll briefly explain how the older approach differs whenever we reach that point. If you want to hear more about GreenTea, Michael Knyszek gave a great talk about it at GopherCon 2025 .

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of garbage collector

garbage collector

Photo of runtime

runtime

Related news:

News photo

LeakNet ransomware uses ClickFix, Deno runtime in stealthy attacks

News photo

Understanding the Go Runtime: The Scheduler

News photo

Understanding the Go Runtime: The Memory Allocator