Is G1GC the default in JDK 15 for any machine class/size?

Thomas Schatzl thomas.schatzl at oracle.com
Wed Aug 19 08:45:57 UTC 2020


Hi,

On 19.08.20 00:42, Bruno Borges wrote:
> Hi,
> 
> Up until JDK 14, SerialGC would be picked by default under certain conditions when the is_server_class_machine() returns false [1][2].
> 
> In JDK 15, at least on the binary available in the Docker image 'openjdk/15-jdk-slim', G1GC is being picked no matter how much memory or CPU is available to a container.

Doesn't help you directly, but on bare metal, the detection works:

$ numactl --physcpubind=1 bin/java -XX:+PrintFlagsFinal -version | egrep 
"UseSerialGC"

gives

      bool UseSerialGC                              = true 
                        {product} {ergonomic}

Can you enable os=trace logging on what the VM thinks what resources are 
available?

> 
> I was not able to find in the source code of jdk15 where it is being indicated that G1GC should always be picked.

You got the right location where the type of machine is determined.

Thomas


More information about the discuss mailing list