Trying out K2 for my Android project (which is ope...
# k2-adopters
v
Trying out K2 for my Android project (which is open source, available here: https://github.com/smileidentity/android). It is throwing
Copy code
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:51)
Caused by: java.lang.RuntimeException: Exception while generating code for:
Caused by: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't transform method node:
invokeSuspend (Ljava/lang/Object;)Ljava/lang/Object;:
Caused by: java.lang.RuntimeException: Exception while generating code for:
Caused by: java.lang.OutOfMemoryError: Java heap space
The full trace and output available here: https://gist.github.com/vanshg/f9e8b125c6ff8edc616fc9d6abc98e80
m
Looks like it's an OOM which you can fix by increasing your max heap size (
org.gradle.jvmargs=-Xmx=${n}G
).
v
Should that be necessary at all though? The code is not doing anything fancy
m
Agreed. And if necessary to trade memory for performance, it should be documented somewhere
v
I wonder if it is worth filing something for this
k
Sure, please create a ticket at kotl.in/issue