How to set "CICompilerCountPerCPU" to false in Java 21

162 views Asked by At

I have tried the JVM arguments like -XX:-CICompilerCountPerCPU -XX:+CICompilerCount=3, -XX:CICompilerCountPerCPU=false -XX:+CICompilerCount=3, but it still shows that CICompilerCountPerCPU=true:

[~]$ java -XX:+PrintFlagsFinal -version| grep CI
     ccstr ArchiveClassesAtExit                     =          {JVMCI product} {default}
     bool AutoCreateSharedArchive                  = false     {JVMCI product} {default}
     intx CICompilerCount                          = 3         {product} {ergonomic}

My purpose is to set the number of JIT threads to a fixed "3", and how can I verify that was effective?

1

There are 1 answers

1
Mark Rotteveel On

Using the following does the trick:

java -XX:-CICompilerCountPerCPU -XX:CICompilerCount=3 -XX:+PrintFlagsFinal -version | grep CICompiler
     intx CICompilerCount                          = 3                                         {product} {command line}
     bool CICompilerCountPerCPU                    = false                                     {product} {command line}
openjdk version "21" 2023-09-19 LTS
OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS)
OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode, sharing)

The obvious difference with your attempt is that you tried with -XX:+CICompilerCount=3, which results in an error because the + and - are only valid for boolean options:

Unexpected +/- setting in VM option 'CICompilerCount=3'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.