1

在 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错误。

请帮助或尝试提供一些解决此问题的想法。

4

0 回答 0