From 28c1690f96c612b777689f86b569a2766684d56d Mon Sep 17 00:00:00 2001 From: Adrian Kuta Date: Mon, 8 Jun 2026 21:58:23 +0200 Subject: [PATCH] fix: raise Gradle daemon heap/Metaspace for the Android (AGP) build The Android target added in #48 brought AGP onto the build's classpath without setting org.gradle.jvmargs, so the Gradle daemon ran on its defaults (512m heap / 384m Metaspace). AGP loads enough classes that, combined with the KMP matrix, binary-compatibility-validator, Kover and Dokka in a single build, the daemon exhausts Metaspace and is killed mid-build (GC thrashing / out of Metaspace). The 'JVM / JS / Wasm / Native / Android + API check' job therefore failed deterministically on master, and the publish job builds the same targets. Set org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g. Verified with a cold full-matrix build locally. --- gradle.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gradle.properties b/gradle.properties index 74a5878..a92dc50 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,3 +4,7 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true # Android: Compose pulls AndroidX artifacts, which AGP requires this flag to consume. android.useAndroidX=true +# AGP loads many classes into the Gradle daemon's Metaspace; combined with the KMP +# matrix, binary-compatibility-validator, Kover and Dokka in a single build, the +# default 512m heap / 384m Metaspace is exhausted (daemon OOM). Raise both. +org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8