Has anybody here hit an issue where your builds co...
# multiplatform
d
Has anybody here hit an issue where your builds consistently fail with
Copy code
> Task :shared:linkReleaseFrameworkIosArm64
e: Compilation failed: Java heap space
And does anybody know how to fix this?
p
Sounds like Gradle needs more RAM. Check the jvmargs Xmx and Xms values, how much they have?
d
Currently I have the following in my gradle.properties file:
Copy code
org.gradle.jvmargs=-Xmx16g -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g
Hrm, is it possible that the iOS having a build failure could cause this issue to occur? I recently made some changes to the Android side of my KMP project, trying to keep my focus on that as the first part of our MVP, and apparently that broke the iOS build.
p
Humm that is possible too, are you using KSP intensively? I have seen bugs around kapt and ksp related to dagger where they eat all the ram
BTW your numbers looks good. I normally set Xmx 8G and Xms 4G. Not sure about 16, if you give too much you are basically allowing the JVM to claim that much memory and MACOS might collapse. How much RAM your MAC has?
I think it is possible that a compilation error could trigger that.
a
in gradle properties try #Kotlin kotlin.daemon.jvmargs=-Xmx4096M #Gradle org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8