Golang is adding a new Garbage Collector called Green Tea in 1

Arpit Bhayani

Arpit Bhayani

Jul 16, 2025 • 1 min read


Golang is adding a new Garbage Collector called Green Tea in 1.25 (opt-in), and it could slash GC overhead by up to 50% 🤯

The current garbage collector in Go treats memory as a flat address space, and therefore, it jumps randomly between objects during collection. This way, GC spends cycles just scanning loops and accessing objects.

Green Tea Garbage Collector flips this by making the garbage collector memory-aware. The idea, again, is very simple

  • GC will now work with 8KiB blocks (span) instead of objects
  • GC thus leverages spatial locality to batch process objects
  • Span stores gray/black bits to avoid expensive pointer chasing
  • The block-based approach unlocks future SIMD acceleration, of course :)

The core trade-off is simple - applications with good spatial locality see massive improvements, while the ones with a lot of random accesses see little improvement or even regression.

If you want to dig deeper, I have linked the discussion thread in the comments.

Hope it helps.

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses