The Green Tea Garbage Collector
Go 1.25 includes a new experimental garbage collector, Green Tea.

Go 1.25 introduces a groundbreaking experimental garbage collector named Green Tea, which is already making waves in the tech community. Developed by Michael Knyszek and Austin Clements, this innovative garbage collector is available for use by setting the environment variable GOEXPERIMENT=greenteagc during the build process. The impact of Green Tea is significant, with many workloads reporting a reduction in garbage collection time by around 10%, while some have even seen a dramatic decrease of up to 40%. Notably, Green Tea is considered production-ready and is already being utilized at Google, underscoring its reliability and efficiency.
The Go Blog provides detailed insights into the Green Tea garbage collector, emphasizing its potential to become the default garbage collector in Go 1.26. The blog post, based on Michael Knyszek's GopherCon 2025 talk, delves into the intricacies of garbage collection and how Green Tea addresses the challenges faced by traditional garbage collectors.
To understand the significance of Green Tea, it's essential to first grasp the basics of garbage collection. The primary goal of garbage collection is to automatically reclaim and reuse memory that is no longer in use by a program. In the context of the Go runtime, garbage collection revolves around objects and pointers. Objects are Go values whose underlying memory is allocated from the heap, while pointers are numbers that indicate the location of a Go value in memory.
The Go compiler often allocates heap objects when it cannot determine a more suitable allocation method. For instance, the code snippet `var x = make([]*int, 10)` creates a single heap object, as the compiler cannot allocate the slice backing store anywhere else. Pointers, on the other hand, allow Go programs to reference these heap objects.
Green Tea's development was driven by the need to optimize garbage collection performance. Traditional garbage collectors can sometimes struggle with certain workloads, leading to inefficiencies and suboptimal memory management. Green Tea addresses these issues by employing advanced algorithms and techniques to minimize the time spent in garbage collection, thereby improving overall program performance.
The introduction of Green Tea has sparked excitement in the Go community, with developers eager to experiment with this new garbage collector. While some workloads may not see significant benefits or may even experience no change, the majority of users have reported positive outcomes. Google's adoption of Green Tea further validates its effectiveness and reliability, making it a compelling option for developers seeking to enhance their applications' performance.
As the Go team continues to refine Green Tea, they are actively seeking feedback from the community. Users are encouraged to report any issues they encounter by filing new issues, while success stories should be shared in the existing Green Tea issue. Based on the data collected so far, the Go team plans to make Green Tea the default garbage collector in Go 1.26, highlighting its potential to become a standard feature in the language.
In conclusion, the Green Tea garbage collector represents a significant leap forward in Go's memory management capabilities. With its impressive performance improvements and production-ready status, Green Tea is poised to become a staple in the Go ecosystem. As the Go team continues to iterate on this innovative garbage collector, developers can look forward to even greater efficiency and optimized performance in their applications.










