From 888ea3db8c9fa068ea616f0ed81f5785dc70f28f Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Tue, 29 Sep 2026 05:42:36 -0700 Subject: [PATCH] ci: fork each Kotlin/Native compile and give the Gradle daemon 8g (#7441) --- .github/ci-gradle.properties | 12 ++++++++---- gradle.properties | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties index cd638cd83e..bc78dce3df 100644 --- a/.github/ci-gradle.properties +++ b/.github/ci-gradle.properties @@ -12,13 +12,17 @@ org.gradle.daemon=false # ── Memory ──────────────────────────────────────────────────────────── -# Public-repo hosted Ubuntu x64 runners have 16 GB RAM. Keep Gradle + Kotlin daemon -# within budget (4g Gradle + 6g Kotlin daemon, leaving room for lint and K/N). +# Public-repo hosted Ubuntu x64 runners have 16 GB RAM; each -Xmx is a ceiling, not a reservation. # 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 +# is a system property. Unset, the daemon inherits org.gradle.jvmargs and OOMs. +org.gradle.jvmargs=-Xmx8g -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8 kotlin.daemon.jvmargs=-Xmx6g -XX:+UseG1GC +# ── Kotlin/Native ───────────────────────────────────────────────────── +# Each K/N compile gets its own JVM with gradle.properties' kotlin.native.jvmArgs heap. In process, +# koin-compiler-plugin 1.2.1 keeps every compile's IR reachable from the Gradle daemon until the build ends. +kotlin.native.disableCompilerDaemon=true + # ── Parallelism ─────────────────────────────────────────────────────── org.gradle.parallel=true org.gradle.workers.max=4 diff --git a/gradle.properties b/gradle.properties index 4d134cf593..0405e5f86a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,8 +15,8 @@ kotlin.code.style=official # 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. +# Applies only where kotlin.native.disableCompilerDaemon forks the Kotlin/Native compiler, as CI +# does; otherwise it runs inside the Gradle daemon and shares org.gradle.jvmargs' heap. kotlin.native.jvmArgs=-Xmx5g -XX\:+UseG1GC -XX\:+HeapDumpOnOutOfMemoryError # Only macOS can run iosSimulatorArm64Test; this hides KGP's notice about it on Linux and Windows hosts. kotlin.native.ignoreDisabledTargets=true