Make +UseZGC fail hard when it is unsupported

Per Liden per.liden at
Thu Jun 14 08:55:42 UTC 2018

Hi Aleksey,

On 06/14/2018 10:45 AM, Aleksey Shipilev wrote:
> Hey guys,
> I have build recent workspace, and forgot to enable zgc in configure. Yet, the runs proceeded as
> usual, and G1 was automatically selected. Per, can you make this failure fatal?

This behavior is in line with how this mechanism works for all other 
GCs, so it's not ZGC specific. E.g. if you build a minimal VM you should 
see the same behavior if you try to enable, say G1.

However, it can certainly be debated whether this is a good behavior or 
not, and I tend to agree with you that it's not.


> $ build/linux-x86_64-normal-server-release/images/jdk/bin/java -XX:+UnlockExperimentalVMOptions
> -XX:+UseZGC -Xlog:gc -version
> OpenJDK 64-Bit Server VM warning: -XX:+UseZGC not supported in this VM
> [0.015s][info][gc] Using G1
> <proceeds as usual>
> Thanks,
> -Aleksey

More information about the zgc-dev mailing list