From 354db2f1db4f6eb68066e2dd76b5911697476d57 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Fri, 11 Sep 2026 06:01:18 -0700 Subject: [PATCH] build: fix the inert Kotlin compile daemon heap property (#7132) --- .github/ci-gradle.properties | 8 +++++--- gradle.properties | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties index 07bd1a4dff..0a206f5188 100644 --- a/.github/ci-gradle.properties +++ b/.github/ci-gradle.properties @@ -12,10 +12,12 @@ org.gradle.daemon=false # ── Memory ──────────────────────────────────────────────────────────── -# Standard GitHub runners have 7 GB RAM. Keep Gradle + Kotlin daemon -# within budget (4g Gradle + 2g Kotlin daemon + 1g OS/tooling headroom). +# Public-repo ubuntu-24.04 runners have 16 GB RAM. Keep Gradle + Kotlin daemon +# within budget (4g Gradle + 6g Kotlin daemon, leaving room for lint and K/N). +# Only kotlin.daemon.jvmargs is read from a properties file; kotlin.daemon.jvm.options +# is a system property. Unset, the daemon inherits org.gradle.jvmargs' 4g and OOMs. org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8 -kotlin.daemon.jvm.options=-Xmx2g -XX:+UseParallelGC +kotlin.daemon.jvmargs=-Xmx6g -XX:+UseG1GC # ── Parallelism ─────────────────────────────────────────────────────── org.gradle.parallel=true diff --git a/gradle.properties b/gradle.properties index f627938bee..82bbb91b96 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ android.defaults.buildfeatures.resvalues=false android.defaults.buildfeatures.shaders=false # Lint analysis runs in its own worker, so neither org.gradle.jvmargs nor -# kotlin.daemon.jvm.options applies to it. The default heap OOMs on a cold analysis. +# kotlin.daemon.jvmargs applies to it. The default heap OOMs on a cold analysis. android.experimental.lint.heapSize=3G # --- Compose --- @@ -13,7 +13,9 @@ enableComposeCompilerReports=false # --- Kotlin --- kotlin.code.style=official -kotlin.daemon.jvm.options=-Xmx4g -XX\:+UseG1GC -XX\:SoftRefLRUPolicyMSPerMB=1 -XX\:ReservedCodeCacheSize=320m -XX\:+HeapDumpOnOutOfMemoryError +# Only kotlin.daemon.jvmargs is read from here; kotlin.daemon.jvm.options is a system +# property. Unset, the daemon inherits org.gradle.jvmargs' 8g and over-commits CI runners. +kotlin.daemon.jvmargs=-Xmx6g -XX\:+UseG1GC -XX\:SoftRefLRUPolicyMSPerMB=1 -XX\:ReservedCodeCacheSize=320m -XX\:+HeapDumpOnOutOfMemoryError kotlin.daemon.useFallback=false # The Kotlin/Native compiler runs in its own JVM, governed by neither of the heaps # above. Its 3g default OOMs compiling every module for iOS from a cold cache.