RFR: 8326957: Implement JEP 474: ZGC: Generational Mode by Default [v4]
Stefan Karlsson
stefank at openjdk.org
Wed May 8 07:59:53 UTC 2024
On Fri, 3 May 2024 17:25:45 GMT, Tom Rodriguez <never at openjdk.org> wrote:
> Graal still doesn't support generational ZGC though I'm actively working on it. I'm hoping to have it in before rampdown but at least until that time JVMCI needs to default to non-generational ZGC.
Great that you are working on support for Generational ZGC!
The intent of this JEP is to make it so that you get Generational ZGC when you specify -XX:+UseZGC, and then warn that non-generational ZGC is deprecated and warn if the user explicitly turns it on. I don't want us to change the meaning of -XX:+UseZGC when the Graal JIT is enabled. Doing so would be inconsistent, cause confusion, and could be misleading to our users.
In fact, we have already seen instances of a somewhat opposite problem. Today if you try to run Generational ZGC with the Graal JIT, you get Generational ZGC but revert back to using C2. We print a warning when that happens, but we have seen users not realizing that they ran C2 instead of the Graal JIT.
My proposal is to simply refuse to start the JVM and print an error message when we have conflicting GC and JIT compiler flags.
With this we would have:
* -XX:+UseZGC -XX:<Use Graal JIT flags> => Refuse to start with error message
* -XX:+UseZGC -XX:-ZGenerational -XX:<Use Graal JIT flags> => Same as above
* -XX:+UseZGC -XX:-ZGenerational -XX:<Use Graal JIT flags> => Start (with message about deprecation of non-generational ZGC)
With this we would both get rid of the confusing situation where the user asks for Graal JIT but get C2 and the other confusing situation where the user asks for Generational ZGC but gets non-generational ZGC. The user will have to make a decision on what combination they want to run.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18393#issuecomment-2099976099
More information about the hotspot-dev
mailing list