Skip to content

ci(android): give the Kotlin compile daemon its own heap#801

Merged
ryanbr merged 1 commit into
mainfrom
ci/kotlin-daemon-heap
Jul 25, 2026
Merged

ci(android): give the Kotlin compile daemon its own heap#801
ryanbr merged 1 commit into
mainfrom
ci/kotlin-daemon-heap

Conversation

@ryanbr

@ryanbr ryanbr commented Jul 25, 2026

Copy link
Copy Markdown
Owner

The 9.1.1 staging build's Android job failed with java.lang.OutOfMemoryError: Java heap space in androidx.compose.compiler.plugins.kotlin.lower.ComposerTypeRemapper.

Not a code error. compileFullDebugKotlin passed in the same run; only compileFullReleaseKotlin died, and the iOS and macOS jobs succeeded. The release variant's extra lowering passes deepen the Compose IR deep-copy enough to exhaust the heap.

kotlin.daemon.jvmargs was never set. The Kotlin compile daemon is a separate process from the Gradle daemon and does not inherit org.gradle.jvmargs, so it was running on a default heap the Compose compiler plugin has outgrown. Gradle's own failure hint names this property.

Raised the Kotlin daemon to 4g rather than lifting org.gradle.jvmargs — Gradle itself never ran out, and raising both would put peak memory somewhere unfriendly on an 8 GB laptop.

Yesterday's staging build passed every job, so this is headroom lost to the Compose UI merged today (#778, #788, #523) rather than a long-standing issue.

Verification is the next staging run — that job is the only thing in CI that builds the release variant, since android.yml is disabled.

compileFullReleaseKotlin died with java.lang.OutOfMemoryError: Java heap space inside
androidx.compose.compiler.plugins.kotlin.lower.ComposerTypeRemapper on the 9.1.1
staging build. Not a code error — compileFullDebugKotlin passed in the same run, and
the iOS and macOS jobs succeeded.

The Kotlin compile daemon is a separate process from the Gradle daemon and does not
inherit org.gradle.jvmargs, and kotlin.daemon.jvmargs was never set — so it ran on a
default heap that the Compose compiler plugin has now outgrown. The release variant
fails where debug passes because its extra lowering passes deepen the IR copy.

Yesterday's staging build passed every job, so this is headroom lost to the Compose UI
merged today (#778, #788, #523) rather than a long-standing problem.

Raised the Kotlin daemon rather than org.gradle.jvmargs: Gradle itself never ran out,
and lifting both would put peak memory somewhere unfriendly on an 8 GB laptop.
@ryanbr
ryanbr merged commit 4d8a186 into main Jul 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant