Hi,
We have been running CircleCI CI/CD on our Android project for quite some time now and today we started to see an error regarding the usage of UseCGroupMemoryLimitForHeap for the Virtual Machine when creating our executor:
Here is the error:
Picked up JAVA_TOOL_OPTIONS: -XX:MaxRAM=3G
Picked up _JAVA_OPTIONS: -Xmx3200m -XX:+UnlockExperimentalVMOptions - XX:+UseCGroupMemoryLimitForHeap
Unrecognized VM option 'UseCGroupMemoryLimitForHeap'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Exited with code exit status 1
CircleCI received exit code 1
Here the executor:
thrive-android-executor:
docker:
- image: circleci/android:api-29
working_directory: ~/src
environment:
_JAVA_OPTIONS: "-Xmx3200m -XX:+UnlockExperimentalVMOptions" # Temporarily removed for now: -XX:+UseCGroupMemoryLimitForHeap"
JVM_OPTS: -Xmx3200m
## circle instances have 4g, set java maxram to 3G manually - java automatics are using bad data from cgroups and/or docker, so we have to manually override this.
JAVA_TOOL_OPTIONS: "-XX:MaxRAM=3G"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx3200m" -Dorg.gradle.parellel=false -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=4'
TERM: dumb
Here is the job that fails:
download-android-dependencies:
description: "Download Android Dependencies"
steps:
- run:
name: Download Android Dependencies
command: ./gradlew androidDependencies