JDK 27 Makes G1 the Default Garbage Collector for All Environments
JDK 27 upgrades the G1 garbage collector to the default for all environments, alongside various performance improvements and updates to heap management…
JDK 27 makes G1 the default garbage collector in every environment under JEP 523. Serial GC is no longer automatically selected on small or constrained machines, meaning developers relying on that behavior must now pass -XX:+UseSerialGC, unless running an OpenJDK distribution lacking G1. Thomas Schatzl of the HotSpot garbage collectors team notes that while G1 performs well as a default starting point, certain application profiles still benefit from Serial GC.
JDK-8238686 changes -XX:MinHeapFreeRatio and -XX:MaxHeapFreeRatio defaults from 40 and 70 percent to 0 and 100 percent, stopping G1 from resizing the heap based on those percentages after a Full GC. This prevents performance hits caused by Full GCs shrinking the heap against conflicting CPU usage heuristics. Explicitly set flags function as before.
Additional G1 updates include JDK-8379846 and JDK-8381006 for adaptive concurrent marking start, JDK-8378331 and JDK-8378336 to stop weak references from keeping reclaimable humongous objects alive, and JDK-8386332 removing MemoryPoolMXBean.getCollectionUsage() updates from Cleanup pauses. JDK-8373894 counts space-starved collections in GC CPU usage to aid heap-sizing.
Parallel GC receives fixes via JDK-8380590, allowing the adaptive tenuring threshold to decrease, and JDK-8377561, preventing thousands of Full GCs during repeated large allocations. Across all stop-the-world collectors, JDK-8381834 improves TLAB sizing for lightly allocating threads, and JDK-8372348 enhances string deduplication logging and JFR events. The GC subcomponent contains roughly 350 resolved changes in JDK 27.
