Does anyone have tips for resolving `StackOverflow...
# multiplatform
g
Does anyone have tips for resolving `StackOverflowError`s coming from the Kotlin/JS compiler at build time? Either suggested gradle configuration changes, or advice on how to track down the root cause within the compiler? I had previously increased the stack size to 32MB using
org.gradle.jvmargs=-Xss32m
in my project's
gradle.properties
file to solve this problem. However, I just updated my Multiplatform project to Kotlin 1.9.23 and my builds again started failing with
StackOverflowError
when running in CI. I tried bumping the stack size to 64MB but it didn't help. What's a reasonable stack size to configure for the Kotlin/JS compiler when building a somewhat complex Multiplatform project? I can't find any guidance about this in the docs. The specific error I'm getting is:
Copy code
e: java.lang.StackOverflowError

	at org.jetbrains.kotlin.js.translate.utils.JsAstUtils.decomposeAssignmentToVariable(JsAstUtils.java:391)
	at org.jetbrains.kotlin.js.inline.clean.TemporaryVariableElimination$analyze$1.processBinaryExpression(TemporaryVariableElimination.kt:141)
> Task :pbandk-runtime:compileTestDevelopmentExecutableKotlinJs FAILED
You can see the entire stack trace at https://github.com/streem/pbandk/actions/runs/8597042113/job/23554863653. I'm running a gradle build using
-Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process -XX:MaxMetaspaceSize=512m -Xmx3g -Xss64m
.