RFR(S): 8068579: Running with -XX:-UseParallelGC does not turn ParalleGC off

Per Liden per.liden at oracle.com
Wed Mar 16 07:49:55 UTC 2016


On 2016-03-15 23:38, Jon Masamitsu wrote:
>
>
> On 3/15/2016 6:48 AM, Per Liden wrote:
>> Summary: Explicitly disabling the default collector, without
>> specifying another collector, will silently re-enable the default
>> collector. This is a bit counter intuitive. A better approach would be
>> for the VM to complain about the situation.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8068579
>> Webrev: http://cr.openjdk.java.net/~pliden/8068579/webrev.0/
>
> Changes look good.

Thanks Jon.

>
> Not part of your changes bug should this code mostly be under
> INCLUDE_ALL_GCS?

It could be, but given that this is a small function I'm not sure it's 
worth the additional #if/#endif we would need in at lease two places.

thanks,
Per

>
> Jon
>
>> Testing: manual, jprt
>>
>> Example (assuming it's a platform/configuration with G1 as default):
>>
>> $ java -XX:-UseG1GC ...
>>
>> Today, the above command will happily start a VM with G1 enabled.
>>
>> With this patch the VM will instead complain, like this:
>>
>> $ java -XX:-UseG1GC ...
>> Error occurred during initialization of VM
>> Garbage collector not selected (default collector explicitly disabled)
>>
>> And of course, we're good with disabling the default collector as long
>> as you specify some other collector, e.g.:
>>
>> $ java -XX:-UseG1GC -XX:+UseParallelGC ...
>>
>> cheers,
>> Per
>


More information about the hotspot-gc-dev mailing list