Why are my Gradle builds dying with exit-code 137?

后端 未结 9 2060
醉酒成梦
醉酒成梦 2020-12-07 23:48

I\'ve been trying to compile and test a large project to use Gradle. The test run fine until they die unexpectedly. I dug around and resources said that this is due to a mem

9条回答
  •  Happy的楠姐
    2020-12-08 00:46

    I had a similar issue with Bamboo agents (running on Docker) running Gradle 4.6. The test task just abruptly terminated with

        build   27-Dec-2018 22:00:20    22:00:20.018 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'Gradle Test Executor 1' finished with exit value 137 (state: FAILED)
    

    We have over 3000 unit tests. In our case, the issue was solved using forkEvery to limit the number of test classes run per test executor process, and also limiting memory usage:

        test {
            maxHeapSize '512m'
            forkEvery 100
            jvmArgs '-Xmx512m', '-Xms512m'
        }
    

提交回复
热议问题