JDK-8240747 : CSR: JEP 377: ZGC: A Scalable Low-Latency Garbage Collector (Production)
  • Type: CSR
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 15
  • Submitted: 2020-03-09
  • Updated: 2020-03-23
  • Resolved: 2020-03-23
Related Reports
CSR :  
Relates :  
Description
Summary
-------

Change the Z Garbage Collector from an experimental feature into a product feature.


Problem
-------

ZGC is currently an experimental feature enabled via the command-line options `-XX:+UnlockExperimentalVMOptions -XX:+UseZGC`. [JEP 377](https://bugs.openjdk.java.net/browse/JDK-8209683) proposes to make ZGC a product (non-experimental) feature, meaning it should be possible to enable without using `-XX:+UnlockExperimentalVMOptions`.

Solution
--------

The following existing command-line options will be changed from `experimental` to `product`. Their default values will remain unchanged.

 - `UseZGC`
 - `ZAllocationSpikeTolerance`
 - `ZFragmentationLimit`
 - `ZMarkStackSpaceLimit`
 - `ZCollectionInterval`
 - `ZProactive`
 - `ZUncommit`
 - `ZUncommitDelay`

Specification
-------------
```
diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp
--- a/src/hotspot/share/gc/shared/gc_globals.hpp
+++ b/src/hotspot/share/gc/shared/gc_globals.hpp
@@ -164,7 +164,7 @@
   experimental(bool, UseEpsilonGC, false,                                   \
           "Use the Epsilon (no-op) garbage collector")                      \
                                                                             \
-  experimental(bool, UseZGC, false,                                         \
+  product(bool, UseZGC, false,                                              \
           "Use the Z garbage collector")                                    \
                                                                             \
   experimental(bool, UseShenandoahGC, false,                                \
diff --git a/src/hotspot/share/gc/z/z_globals.hpp b/src/hotspot/share/gc/z/z_globals.hpp
--- a/src/hotspot/share/gc/z/z_globals.hpp
+++ b/src/hotspot/share/gc/z/z_globals.hpp
@@ -38,26 +38,26 @@
                    range,                                                   \
                    constraint)                                              \
                                                                             \
-  experimental(double, ZAllocationSpikeTolerance, 2.0,                      \
+  product(double, ZAllocationSpikeTolerance, 2.0,                           \
           "Allocation spike tolerance factor")                              \
                                                                             \
-  experimental(double, ZFragmentationLimit, 25.0,                           \
+  product(double, ZFragmentationLimit, 25.0,                                \
           "Maximum allowed heap fragmentation")                             \
                                                                             \
-  experimental(size_t, ZMarkStackSpaceLimit, 8*G,                           \
+  product(size_t, ZMarkStackSpaceLimit, 8*G,                                \
           "Maximum number of bytes allocated for mark stacks")              \
           range(32*M, 1024*G)                                               \
                                                                             \
-  experimental(uint, ZCollectionInterval, 0,                                \
+  product(uint, ZCollectionInterval, 0,                                     \
           "Force GC at a fixed time interval (in seconds)")                  \
                                                                             \
-  experimental(bool, ZProactive, true,                                      \
+  product(bool, ZProactive, true,                                           \
           "Enable proactive GC cycles")                                     \
                                                                             \
-  experimental(bool, ZUncommit, true,                                       \
+  product(bool, ZUncommit, true,                                            \
           "Uncommit unused memory")                                         \
                                                                             \
-  experimental(uintx, ZUncommitDelay, 5 * 60,                               \
+  product(uintx, ZUncommitDelay, 5 * 60,                                    \
           "Uncommit memory if it has been unused for the specified "         \
           "amount of time (in seconds)")                                    \
                                                                             \
```
Comments
Moving to Approved for JDK 15. If the work ends up being targeted to a different release, please withdraw and re-finalize the request with the eventual release.
23-03-2020