Since upgrading to 2.4.0 I'm running into an OOM e...
# webassembly
c
Since upgrading to 2.4.0 I'm running into an OOM error in the WasmIrFileMetadata (which looks like its already killed/changed on master): https://github.com/JetBrains/kotlin/commit/55852ef178eb2be327182836121336b2af3763cf
I've checked through the build info and did a heap dump and am 99% sure its not a memory issue, though. I more expect its related to the varying things around: https://youtrack.jetbrains.com/issue/KT-84610/Wasm-Failed-to-compile-klibs-in-IC-mode
But I can't find any good ways to dump what the metadata is failing on. If anyone knows any good way it would be appreciated.
Copy code
Size metrics:
    Analysis lines per second: 1695
  Total size of the cache directory: 2.3 MB
  Total compiler iteration: 1
  Increase memory usage: 355.3 MB
  Total memory usage at the end of build: 377.1 MB
    ABI snapshot size: 49 B
    Number of lines analyzed: 5860
  Start time of task action: 2026-06-12T18:07:52
those are my size metrics from my initial build and I have given the thing gigs and gigs, I assume my
count
is nonsense in the lowLevelReaders here: https://github.com/JetBrains/kotlin/blob/master/compiler/util-klib/src/org/jetbrains/kotlin/library/impl/lowLevelReaders.kt#L138 which would follow some of the other issues that have been reported with/around the IR metadata reader
If anyone runs into this or something like it, I narrowed it down to a simple case of two files with a @JsExport: https://github.com/cbrunsdon/kotlin-wasm-oom-example But it seems fixed in
2.4.20-dev-6138
b
@Clarke could you please file an issue at kotl.in/issue?
c
@bashor even though its fixed on -dev-6138?
b
It seems more like "the fix" is a side effect of some changes, so it might be better to investigate
c
Aye, I was vaguely going to try putting a test case together but going from the 2.4 branch to master was what lead to me swapping to the the -dev-6138 release and moving on. https://youtrack.jetbrains.com/issue/KT-87078/Multiple-files-with-JsExport-throws-OutOfMemoryError
b
Thanks!