From 14afe6639dbd5cb1fa2b4ce5a1935a185583e694 Mon Sep 17 00:00:00 2001 From: Mas Azalya Date: Fri, 16 Oct 2026 12:23:02 +0800 Subject: [PATCH] DEV-1115 Give the CI Gradle daemon 4 GB and a 30-minute timeout The first CI run ran out of heap (Gradle's default 512 MB) while D8 dexed the examples, and the daemon then hung until GitHub cancelled the job at 6 hours. gradle.properties is gitignored, so pass org.gradle.jvmargs on the command line, and cap the job at 30 minutes. Reproduced locally (JDK 17, Gradle 8.5): at -Xmx512m the build fails with "D8: java.lang.OutOfMemoryError: Java heap space"; at -Xmx4g it passes in 4m47s with assembleDebug run in all 12 modules. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4b8ee77..f551bc0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: build: name: Build library and examples runs-on: ubuntu-latest + timeout-minutes: 30 # a hung Gradle daemon otherwise holds the runner for 6 hours permissions: contents: read packages: read @@ -51,6 +52,9 @@ jobs: uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 # gradle.properties is gitignored here, so android.useAndroidX (needed for the androidx - # dependencies) is passed on the command line. + # dependencies) and the daemon heap are passed on the command line. Gradle's default 512 MB + # heap runs out while dexing the examples, and the daemon then hangs instead of failing. - name: Build the library and every example - run: ./gradlew assembleDebug --continue -Pandroid.useAndroidX=true + run: >- + ./gradlew assembleDebug --continue -Pandroid.useAndroidX=true + -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=1g"