美文网首页
JVM garbage collector thrashing

JVM garbage collector thrashing

作者: 草帽lufei | 来源:发表于2022-01-12 19:52 被阅读0次

    React Native Android 项目使用 ./gradlew assembleRelease 命令打包报错 Gradle build daemon has been stopped: JVM garbage collector thrashing and after running out of JVM memory

    控制台报错截图如下

    项目在昨天之前一直都是可以正常打 release 包的,环境也没有变化,只是提交了少量业务代码,通过删除 build 文件,执行 ./gradlew clean 命令后重新打包也失败

    解决方式

    gradle.properties 文件中添加 org.gradle.jvmargs=-Xmx4096M 配置即可

    org.gradle.jvmargs=(JVM arguments)

    Specifies the JVM arguments used for the Gradle Daemon. The setting is particularly useful for configuring JVM memory settings for build performance. This does not affect the JVM settings for the Gradle client VM. The default is -Xmx512m "-XX:MaxMetaspaceSize=256m".

    参考链接

    https://stackoverflow.com/questions/59624003/daemon-is-stopping-immediately-jvm-garbage-collector-thrashing-and-after-running

    https://docs.gradle.org/current/userguide/build_environment.html

    相关文章

      网友评论

          本文标题:JVM garbage collector thrashing

          本文链接:https://www.haomeiwen.com/subject/nxtgcrtx.html