@@ -67,6 +67,15 @@ jobs:
68 tool-cache: false
68 tool-cache: false
69 android: false
69 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.
74+ sudo fallocate -l 8G /multigram-swap
75+ sudo chmod 600 /multigram-swap
76+ sudo mkswap /multigram-swap
77+ sudo swapon /multigram-swap
70 - uses: actions/setup-java@v4
79 - uses: actions/setup-java@v4
72 distribution: temurin
81 distribution: temurin
@@ -84,6 +93,10 @@ jobs:
85 vars=gradle.properties
94 vars=gradle.properties
86 echo "org.gradle.workers.max=1" >> $vars
95 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
87 [ -n "$APP_ID" ] && echo "APP_ID=$APP_ID" >> $vars
100 [ -n "$APP_ID" ] && echo "APP_ID=$APP_ID" >> $vars
88 [ -n "$APP_HASH" ] && echo "APP_HASH=$APP_HASH" >> $vars
101 [ -n "$APP_HASH" ] && echo "APP_HASH=$APP_HASH" >> $vars
89 echo "RELEASE_KEYSTORE_FILE=$PWD/TMessagesProj/config/release.keystore" >> $vars
102 echo "RELEASE_KEYSTORE_FILE=$PWD/TMessagesProj/config/release.keystore" >> $vars