On Wed, 3 May 2023 09:04:50 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:
> Hi all, > > Please review the implementation of Generational ZGC, which can be turned on > by adding -XX:+ZGenerational in addition to using -XX:+UseZGC. Generational > ZGC is a major rewrite of the non-generational ZGC version that exists in the > openjdk/jdk repository. It splits the heap into two generations; the young > generation where newly allocated objects are born, and the old generation > where long-lived objects get promoted to. The motivation for introducing > generations is to allow ZGC to reclaim memory faster by not having to walk > the entire object graph every time a garbage collection is run. This should > make Generational ZGC suitable for more workloads. In particular workloads > that previously hit allocation stalls because of high allocation rates, large > live sets, or limited spare machine resources, have the potential to work > better with Generational ZGC. For an in-depth description of Generational > ZGC, see https://openjdk.org/jeps/439. > > The development of Generational ZGC started around the same time as the > development of JDK 17. At that point we forked off the Generational ZGC > development into its own branch and let non-generational live unaffected in > openjdk/jdk. This safe-guarded non-generational ZGC and allowed Generational > ZGC to move unhindered, without the shackles of having to fit into another GC > implementation's design and quirks. Since then, almost all of the ZGC files > have been changed. Moving forward to today, when it's ready for us to > upstream Generational ZGC, we now need to deliver Generational ZGC without > disrupting our current user-base. We have therefore opted to initially > include both versions of ZGC in the code base, but with the intention to > deprecate non-generational ZGC in a future release. Existing users running > with only -XX:+UseZGC will get the non-generational ZGC, and users that want > the new Generational ZGC need to run with -XX:+ZGenerational in addition to > -XX:+UseZGC. The intention i s to give the users time to validate and deploy their workloads with the new GC implementation. > > Including both the new evolution of a GC and its legacy predecessor poses a > few challenges for us GC developers. The first reaction could be to try to > mash the two implementations together and sprinkle the GC code with > conditional statements or dynamic dispatches. We have done similar > experiments before. When ZGC was first born, we started an experiment where > we converted G1 into getting the same features as the evolving ZGC. It was > quite clea... This pull request has now been integrated. Changeset: d20034b0 Author: Stefan Karlsson <stef...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/d20034b09c99026e7dc2213f7d88ebdc85e5b1e7 Stats: 67359 lines in 684 files changed: 58192 ins; 4252 del; 4915 mod 8307058: Implementation of Generational ZGC Co-authored-by: Stefan Karlsson <stef...@openjdk.org> Co-authored-by: Erik Österlund <eosterl...@openjdk.org> Co-authored-by: Axel Boldt-Christmas <abold...@openjdk.org> Co-authored-by: Per Liden <pli...@openjdk.org> Co-authored-by: Stefan Johansson <sjoha...@openjdk.org> Co-authored-by: Albert Mingkun Yang <ay...@openjdk.org> Co-authored-by: Erik Helin <ehe...@openjdk.org> Co-authored-by: Roberto Castañeda Lozano <rcastaned...@openjdk.org> Co-authored-by: Nils Eliasson <nelia...@openjdk.org> Co-authored-by: Martin Doerr <mdo...@openjdk.org> Co-authored-by: Leslie Zhai <lz...@openjdk.org> Co-authored-by: Fei Yang <fy...@openjdk.org> Co-authored-by: Yadong Wang <yadongw...@openjdk.org> Reviewed-by: eosterlund, aboldtch, rcastanedalo ------------- PR: https://git.openjdk.org/jdk/pull/13771