Search code examples
javajavafxgraalvm

Using Generational ZGC for JavaFX application running with GraalVM-21 takes warning about not supporting JVMCI, why?


  • OS: MacOS 12.7.3 (intel)
  • JDK:
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13->jvmci-23.1-b30)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13->jvmci-23.1-b30, mixed mode, sharing)
  • JavaFX version: 21.0.2
  • javafx-maven-plugin.version: 0.0.8
  • javafx.staticSdk.version: 21-ea+11.1

I runned the JavaFX application by GraalVM 21 using javafx-maven-plugin. This is JVM options I given to:

<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>${javafx-maven-plugin.version}</version>
    <executions>
        <execution>
            <!-- Default configuration for running with: mvn clean javafx:run -->
            <id>default-cli</id>
            <configuration>
                <mainClass>${mainClass}</mainClass>
                <launcher>app</launcher>
                <jlinkZipName>app</jlinkZipName>
                <jlinkImageName>app</jlinkImageName>
                <noManPages>true</noManPages>
                <stripDebug>true</stripDebug>
                <noHeaderFiles>true</noHeaderFiles>
                <options>
                    <option>-XX:+UseZGC</option>
                    <option>-XX:+ZGenerational</option>
                </options>
            </configuration>
        </execution>
    </executions>
</plugin>

As you see, Generational ZGC is turned on, but brings a tip of waring:

[INFO] <<< javafx-maven-plugin:0.0.8:run (default-cli) < process-classes @ jfxdemo <<<
[INFO] 
[INFO] 
[INFO] --- javafx-maven-plugin:0.0.8:run (default-cli) @ jfxdemo ---
[0.004s][warning][gc,jvmci] Setting EnableJVMCI to false as selected GC does not support JVMCI: z gc

What does this mean? Is that meaning my application can't be optimized by graal?

Nothing did, just for question.


Solution

  • From these Graal issue tracker cases:

    1. ZGC is supported with Graal on recent Java versions (JDK 17+).
    2. But Generational ZGC is not yet supported (<= JDK 21).

    Developer comment:

    As some of you have pointed out, ZGC has landed in GraalVM for JDK 17+ (see #6170). We are tracking support for Generational ZGC in #8117: [GR-45919] Add support for Generational ZGC on HotSpot.