Not able to turn off G1 GC in JDK-9 preview builds?

Bengt Rutisson bengt.rutisson at oracle.com
Thu Mar 31 09:12:34 UTC 2016


Just FYI,

With the fix for:

Running with -XX:-UseParallelGC does not turn ParalleGC off
https://bugs.openjdk.java.net/browse/JDK-8068579

That was recently pushed to JDK 9 you will get the following error 
message if you try to disable the default GC:

Garbage collector not selected (default collector explicitly disabled)

Thanks,
Bengt

On 2016-03-31 10:53, Thomas Schatzl wrote:
> Hi,
>
> On Thu, 2016-03-31 at 11:44 +0300, Attila-Mihaly Balazs wrote:
>> Hello,
>>
>> I'm trying to do some benchmarks and was curious what effect using /
>> not using G1 GC had on it. However I'm unable to turn it off in the
>> latest JDK-9 beta build (111):
> Only trying to disable collectors and not giving an alternative will
> fall back to the default collector since you need a collector to run.
> Since G1 is the default collector in this build, it will fall back to
> G1.
>
> The same happens if you only specify -XX:-ParallelGC on the JDK8
> command line.
>
>> ~/jdk-9-111/bin/java -XX:-UseG1GC -XX:+PrintFlagsFinal -version |
>> grep
>> UseG1GC
>>       bool UseG1GC                                  :=
>> true                                {product}
>> java version "9-ea"
>> Java(TM) SE Runtime Environment (build 9-ea+111)
>> Java HotSpot(TM) 64-Bit Server VM (build 9-ea+111, mixed mode)
>>
>> With JDK-8 this works as expected:
> In JDK8 the default collector is parallel gc.
>
>> Any pointers as to what my be the issue? I understand that there is a
>> push to use G1 GC by default in Java 9, however it was my
>> understanding that the previous GC algorithms will still be
>> available.
> Explicitly enable a different collector, e.g. -XX:+UseParallelGC.
>
> You do not need to specify -XX:-Use<default>GC if you want to enable a
> different collector.
>
> Thanks,
>    Thomas
>



More information about the jdk9-dev mailing list