CircleCI:如何处理Java OOM错误

时间:2018-09-25 11:12:01

标签: android circleci circleci-2.0

在CircleCI上运行测试时出现OOM错误,如下所示:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:testDebugUnitTest'.
> Process 'Gradle Test Executor 1' finished with non-zero exit value 137

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or -- 
debug option to get more log output. Run with --scan to get full insights.

config.yml文件的部分配置:

version: 2
jobs:
  build-and-test:   
    working_directory: ~/carepilot-android/
    docker:
      - image: circleci/android:api-25-alpha

    environment:

      JVM_OPTS: -Xmx3200m             
      CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
      CIRCLE_TEST_REPORTS: /tmp/circleci-test-results

    steps:
      - checkout
    ...

我尝试更改“环境”配置:

environment:
  TERM: dumb
  _JAVA_OPTIONS: "-Xms512m -Xmx1024m"     
  GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=true'

或:

environment:
  JAVA_TOOL_OPTIONS: -Xmx1024m

我仍然收到OOM错误。

请帮助或尝试提供一些解决方法。

0 个答案:

没有答案