JEP 377: Promote ZGC from experimental garbage collector to production feature
Z Garbage Collector has been part of the JDK since Java 11. Since then lots of new features and enhancements have been made to ZGC, resulting in a long time as an experimental feature. However, because no ZGC-specific bugs have been reported in months, JEP 377 proposes to change its status from experimental to production.
With the release of Java 11 in September 2018, Z Garbage Collector was integrated into the JDK as an experimental feature. Now, with the upcoming release of Java 15 two years later, JEP owner Per Liden proposes to make ZGC a production feature.
JEP 377: Make ZGC a production feature
In JEP 377, Per Linden writes, “With the stability, feature set, and platform support that ZGC has today, it is time to remove its experimental status and make it a product feature.”
JEP 333 integrated Z Garbage Collector into the Java Development Kit. Since then, ZGC has received a number of bug fixes, features and enhancements. These include concurrent class unloading, uncommitting unused memory (JEP 351), increasing the max heap size from 4TB to 16TB and decreasing the minimum heap size to 8MB. Further important highlights are
-XX:SoftMaxHeapSize, support for the JFR leak profiler, support for class-data sharing, limited and discontiguous address spaces, support for placing the heap on NVRAM, improved NUMA awareness, and multi-threaded heap pre-touching.
With all of this in mind, Linden says, it’s time to make ZGC a production feature of the JDK.
SEE ALSO: Java 15 news and updates
JEP 377: Bringing an experimental Java feature into production
As an experimental feature, ZGC must be enabled using the
-XX:+UnlockExperimentalVMOptions option. Changing ZGC to a production feature will remove this step, allowing the
UseZGC command to be used without enabling experimental features. In addition, the following ZGC-specific options would also be changed from experimental to product:
Other necessary changes include the ZGC-specific Java Flight Recorder event
ZPageAllocation, which needs to be changed from experimental to product, and some tests will have to be adjusted. This is because they currently use the
UnlockExperimentalVMOptions command-line option when enabling ZGC, and it will no longer be necessary once the garbage collector is a product feature.