In OpenJDK 27, the G1 garbage collector has been designated as the default for all environments. This means that if no specific garbage collection algorithm is explicitly chosen via command-line options, G1 will be used. This decision eliminates the previous system of selecting different collectors based on environmental conditions, which was deemed a burden rather than an advantage.
The shift to G1 as the universal default is attributed to its consistent improvements in throughput, footprint, and latency profile, which have brought it closer to the performance of the Serial GC in recent releases. While Serial GC can still be manually selected using the `-XX:+UseSerialGC` option for specific application profiles where it might perform better, G1 is now considered the optimal starting point for most applications.
The JDK 27 release includes approximately 350 changes to the garbage collection subcomponent, with about half of these being refactorings and code cleanups. A significant refactoring involved replacing the use of `volatile` and `AtomicAccess` methods for cross-thread shared variables with `Atomic<T>`, making their usage more explicit. Other notable improvements include cleanups to the G1 state machine and general code enhancements.
Roughly 35% of the changes address bug fixes and general improvements to correctness and robustness within the garbage collector code. The remaining changes introduce new or revised behaviors and features for HotSpot's stop-the-world collectors. Infrastructure work for JEP 401: Value Objects (Preview), such as adapting object iterators and eager reclaim, was also integrated.
Beyond the default status, G1 also received an update where it no longer resizes the heap after a Full GC based on the `-XX:MinHeapFreeRatio` and `-XX:MaxHeapFreeRatio` parameters. This change streamlines G1's heap management behavior.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
OpenJDK 27 will make the G1 garbage collector the default for all environments, removing the previous conditional defaults. This change reflects G1's improved performance and simplifies garbage collector selection for developers.