android-ci: 2 GB of Gradle heap for the cuprated release packaging
Some checks failed
android-ci / android (pull_request) Failing after 2s

Run 414 (PR #114) died in `:app:packageRelease` after a clean build:

    Execution failed for task ':app:packageRelease'.
    > A failure occurred while executing
      com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable

with no `Caused by` line and nothing else in the log — and it is not
reproducible on the same content: runs 412 and 413 (this tree, 1 GB heap)
packaged fine. The one budget in this build that got tight when cuprate came in
is the single-use Gradle daemon's heap, which now compresses a 55 MB SDK lib
(plus RandomX's 1.1 MB) in-process; the runner has 15 GB and the job's peak RSS
is ~3 GB, so 2 GB of heap costs nothing and removes the most likely mechanism.
android-release.yml gets the same number: it packages the same APK.
This commit is contained in:
agent 2026-09-18 18:15:52 -04:00
commit c5e2cae694
No known key found for this signature in database
2 changed files with 16 additions and 2 deletions

View file

@ -230,6 +230,13 @@ jobs:
docker volume create "$GRADLE_VOLUME" >/dev/null
docker rm -f "$BUILD_CONTAINER" >/dev/null 2>&1 || true
docker pull "$ANDROID_IMAGE"
# 2 GB of Gradle heap, not 1: the only budget in this build that is close
# is the single-use daemon's heap, which now has to package a 55 MB SDK
# lib (plus RandomX's 1.1 MB) through AGP's in-daemon packaging. Run 414
# died in `:app:packageRelease` with the cause hidden inside
# `PackageAndroidArtifact$IncrementalSplitterRunnable` — no "Caused by"
# line, nothing in the log — so give it room instead of guessing again.
# The runner has 15 GB and the job's peak RSS is ~3 GB.
docker create --name "$BUILD_CONTAINER" -i \
-e CARGO_TERM_COLOR=never \
-e CARGO_BUILD_JOBS="$CARGO_BUILD_JOBS" \
@ -243,7 +250,7 @@ jobs:
-e ONIONWIRE_REQUIRE_RELEASE_KEY=false \
-e RUST_TOOLCHAIN="$RUST_TOOLCHAIN" \
-e ANDROID_CMDLINE_TOOLS_URL="$ANDROID_CMDLINE_TOOLS_URL" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx1024m -XX:MaxMetaspaceSize=384m -Dfile.encoding=UTF-8" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
-v "$SDK_VOLUME":/opt/android-sdk \
-v "$CARGO_VOLUME":/cargo \
-v "$TARGET_VOLUME":/cargo-target \

View file

@ -299,6 +299,13 @@ jobs:
docker volume create "$GRADLE_VOLUME" >/dev/null
docker rm -f "$BUILD_CONTAINER" >/dev/null 2>&1 || true
docker pull "$ANDROID_IMAGE"
# 2 GB of Gradle heap, not 1: the only budget in this build that is close
# is the single-use daemon's heap, which now has to package a 55 MB SDK
# lib (plus RandomX's 1.1 MB) through AGP's in-daemon packaging. Run 414
# died in `:app:packageRelease` with the cause hidden inside
# `PackageAndroidArtifact$IncrementalSplitterRunnable` — no "Caused by"
# line, nothing in the log — so give it room instead of guessing again.
# The runner has 15 GB and the job's peak RSS is ~3 GB.
docker create --name "$BUILD_CONTAINER" -i \
-e CARGO_TERM_COLOR=never \
-e CARGO_BUILD_JOBS="$CARGO_BUILD_JOBS" \
@ -314,7 +321,7 @@ jobs:
-e ONIONWIRE_VERSION="$VERSION" \
-e RUST_TOOLCHAIN="$RUST_TOOLCHAIN" \
-e ANDROID_CMDLINE_TOOLS_URL="$ANDROID_CMDLINE_TOOLS_URL" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx1024m -XX:MaxMetaspaceSize=384m -Dfile.encoding=UTF-8" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
-v "$SDK_VOLUME":/opt/android-sdk \
-v "$CARGO_VOLUME":/cargo \
-v "$TARGET_VOLUME":/cargo-target \