Hey guys, has anyone faced `java.lang.OutOfMemoryE...
# multiplatform
y
Hey guys, has anyone faced
java.lang.OutOfMemoryError: Java heap space
when building for testflight on a ComposeMultiplatform project?
a
Did you enable configuration cache? if so, try disabling it and check again 🙏
y
Copy code
#Kotlin
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2g
kotlin.native.jvmArgs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+UseG1GC -XX:MaxHeapFreeRatio=70 -XX:MinHeapFreeRatio=30
kotlin.native.cacheKind=none
kotlin.mpp.enableCInteropCommonization=true
ksp.useKSP2=true

#Gradle
org.gradle.jvmargs=-Xmx12288M -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8
org.gradle.configuration-cache=false
org.gradle.caching=true
org.gradle.workers.max=2

#Android
android.nonTransitiveRClass=true
android.useAndroidX=true
I think I have already did that. this is my gradle.properties file if it helps.
we are just migrating to CMP for our ios client and we rely on some vendor SDKs and a bit of Swift wrappers to call those vendor methods. the project is fairly medium sized. I have attempted to fix it by giving it 12 gigs of maximum heap size but still fails to build it. (I am on M1 16 gigs)
Anyone?
a
Perhaps you can try reducing number of subprojects. And provide memory profiler report
y
Alright
y
if anyone cares, I ended up upgrading the machine to a 32 gigs one and then maxxed out all the Java heaps as much as I can.
Copy code
kotlin.daemon.jvmargs=-Xmx12g
kotlin.native.jvmArgs=-Xmx20g -XX:+UseG1GC
org.gradle.jvmargs=-Xmx16384M -Dfile.encoding=UTF-8 "-Dkotlin.daemon.jvm.options=-Xmx16384M"