RFR: ZGC: stricter flag handling

Per Liden per.liden at oracle.com
Wed May 23 09:58:12 UTC 2018


Looks good!

/Per

On 05/23/2018 09:53 AM, Stefan Karlsson wrote:
> Hi all,
> 
> Please review this patch.
> 
> 1) Check for -XX:ParallelGCThreads=0 and -XX:ConcGCThreads=0 and print 
> the same error message as G1.
> 
> 2) Set ClassUnloading and ClassUnloadingWithConcurrentMark to false.
> 
> diff --git a/src/hotspot/share/gc/z/zArguments.cpp 
> b/src/hotspot/share/gc/z/zArguments.cpp
> --- a/src/hotspot/share/gc/z/zArguments.cpp
> +++ b/src/hotspot/share/gc/z/zArguments.cpp
> @@ -53,11 +53,20 @@
>       FLAG_SET_DEFAULT(ParallelGCThreads, ZWorkers::calculate_nparallel());
>     }
> 
> +  if (ParallelGCThreads == 0) {
> +    vm_exit_during_initialization("The flag -XX:+UseZGC can not be 
> combined with -XX:ParallelGCThreads=0");
> +  }
> +
>     // Select number of concurrent threads
>     if (FLAG_IS_DEFAULT(ConcGCThreads)) {
>       FLAG_SET_DEFAULT(ConcGCThreads, ZWorkers::calculate_nconcurrent());
>     }
> 
> +  if (ConcGCThreads == 0) {
> +    vm_exit_during_initialization("The flag -XX:+UseZGC can not be 
> combined with -XX:ConcGCThreads=0");
> +  }
> +
> +
>   #ifdef COMPILER2
>     // Enable loop strip mining by default
>     if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
> @@ -75,6 +84,10 @@
>     FLAG_SET_DEFAULT(UseCompressedOops, false);
>     FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
> 
> +  // ClassUnloading not (yet) supported
> +  FLAG_SET_DEFAULT(ClassUnloading, false);
> +  FLAG_SET_DEFAULT(ClassUnloadingWithConcurrentMark, false);
> +
>     // Verification before exit not (yet) supported
>     FLAG_SET_DEFAULT(VerifyBeforeExit, false);
>   }
> 
> Thanks,
> StefanK


More information about the zgc-dev mailing list