ci(android): give the Kotlin compile daemon its own heap#801
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 9.1.1 staging build's Android job failed with
java.lang.OutOfMemoryError: Java heap spaceinandroidx.compose.compiler.plugins.kotlin.lower.ComposerTypeRemapper.Not a code error.
compileFullDebugKotlinpassed in the same run; onlycompileFullReleaseKotlindied, 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.jvmargswas never set. The Kotlin compile daemon is a separate process from the Gradle daemon and does not inheritorg.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.ymlis disabled.