• 操作系统:MacOS 12.7.3(英特尔)
  • 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版本:21.0.2
  • 帖子主题:Re:Колибри
  • Javafx.staticSdk.Version:21-EA+11.1

我使用JavaFX-maven-plugin通过GraalVM21运行了JavaFX应用程序. 这是我提供给以下用户的JVM选项:

<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>

正如你所看到的,代际ZGC是打开的,但也带来了一些警告:

[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

这是什么意思?这是不是意味着我的应用程序不能通过Graal进行优化?

什么都没有发生,只是为了质疑.

推荐答案

从这些严重问题跟踪器 case 中:

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

Developer comment:

正如你们中的一些人所指出的,ZGC已经在JDK 17+上登陆了GraalVM(参见#6170).我们正在跟踪#8117: [GR-45919] Add support for Generational ZGC on HotSpot中对代际ZGC的支持情况.

Java相关问答推荐

是否有一种格式模式,可以在除0之外的数字前面有正负符号?

更新我们的一个文物后出现了严重的符号引用错误

Mat. n_Delete()和Mat. n_release的区别

为什么Java的代码工作(if condition内部的实例)

Java inline Double条件和值解装箱崩溃

Java中实现的归并排序算法给出ArrayIndexOutOfBound异常

无法了解Java线程所消耗的时间

未找到适用于响应类型[类java.io.InputStream]和内容类型[Text/CSV]的HttpMessageConverter

用OSQL创建索引

每次FXMLLoader调用ApplationConext.getBean(类)时创建@Component的新实例

为什么当我创建Robot对象时,JavaFX引发IlLegalStateException异常?

是否为计划任务补偿系统睡眠?

如何在JUNIT测试中覆盖ExecutorService?

当b是一个字节并且在Java中值为-1时,为什么b>;>;>;1总是等于-1?

通过Java列表中的某些字段搜索值

每次我需要时创建和关闭数据库连接会有什么效果吗?

记录是类的语法糖吗?

如何使用Jackson读取以方括号开头的JSON?

为什么child-pom会创建一个新版本

在java中使用SevenZip.openArchive方法后无法删除文件