【问题标题】:How can I resolve OutOfMemory Error from gradle build?如何解决 gradle build 中的 OutOfMemory 错误?
【发布时间】:2021-06-02 18:42:48
【问题描述】:
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ConnnectionExpirer"

*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message can't create name string at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 827


Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ExpirationReaper-0-Fetch"

在我的 gradle.properties org.gradle.jvmargs=-Xmx8G -XX:MaxPermSize=2024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

我的 gradle 发行版是 gradle-6.4.1

我最近在我的代码中包含了许多集成测试,之后我开始看到这个错误。

【问题讨论】:

    标签: java gradle build.gradle gradlew


    【解决方案1】:

    我遇到了同样的问题。这是 Gradle 的功能。如果您打开任务管理器,您可以看到 java 进程(Gradle 守护进程),每次运行测试都会占用越来越多的内存。当您打开 Gradle 日志文件时,您会看到很多错误 "Connection timeout"。我正在阅读其他人的 cmets,他们会写 - 这是一个错误。 因此,如果您使用IntelliJ IDEA,则有一个名为"Easy Gradle" 的插件,其命令为Gradle Kill。我用它。它会杀死 Gradle 的守护进程。

    查看更多here

    【讨论】:

      猜你喜欢
      • 2017-12-11
      • 2019-09-25
      • 1970-01-01
      • 1970-01-01
      • 2020-12-16
      • 2020-02-29
      • 2016-11-02
      • 2017-01-07
      相关资源
      最近更新 更多