on main help sign in
Give the APK build swap space and smaller Java heaps

Private-repository runners have about 8 GB of memory. Forkgram's gradle.properties asks for an 8 GB Gradle heap (sized for public-repository runners), and with the Kotlin daemon and the native build on top the runner ran out of memory and lost contact after 90 minutes, leaving no log. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mVy1fu8zBn38wHgJqmLNz

commit6ed4fa7d99795d58f93f854c23280ac996f32a69 authorClaude <noreply@anthropic.com> dateSun 27 Sep 2026, 07:38 (2 weeks ago) parent07823f1
1 file changed+13
.github/workflows/build.yml+13
.github/workflows/build.yml+13
@@ -67,6 +67,15 @@ jobs:
6767 with:
6868 tool-cache: false
6969 android: false
70+ - name: Add swap space
71+ # Runners for private repositories have about 8 GB of memory; the native build and the
72+ # Gradle and Kotlin daemons together can use more, and the runner dies without a log.
73+ run: |
74+ sudo fallocate -l 8G /multigram-swap
75+ sudo chmod 600 /multigram-swap
76+ sudo mkswap /multigram-swap
77+ sudo swapon /multigram-swap
78+ free -h
7079 - uses: actions/setup-java@v4
7180 with:
7281 distribution: temurin
@@ -84,6 +93,10 @@ jobs:
8493 run: |
8594 vars=gradle.properties
8695 echo "org.gradle.workers.max=1" >> $vars
96+ # Forkgram asks for an 8 GB heap, sized for the bigger runners of public repositories.
97+ echo "org.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=768m -Dfile.encoding=UTF-8" >> $vars
98+ echo "kotlin.daemon.jvmargs=-Xmx2g" >> $vars
99+ echo "org.gradle.parallel=false" >> $vars
87100 [ -n "$APP_ID" ] && echo "APP_ID=$APP_ID" >> $vars
88101 [ -n "$APP_HASH" ] && echo "APP_HASH=$APP_HASH" >> $vars
89102 echo "RELEASE_KEYSTORE_FILE=$PWD/TMessagesProj/config/release.keystore" >> $vars