My compiler unit tests (standard test infrastructu...
# compiler
t
My compiler unit tests (standard test infrastructure) started to fail with out of memory. For now, I've limited parallel running with
junit-platform.properties
. Is this OK? Should I try to go deeper into the details? I've checked memory consumption and it seems like there is no memory leak in the tests, without parallel they work just fine.
d
What is your xmx and the number of CPU cores? In Kotlin repo we have
-Xmx4096m
and limitation of maximum parallel thread to 16, and everything works fine
t
-Xmx4g
so, the same, I've run on 12 threads but lowered it to 4 this morning. It might not matter but I have my core library added to the classpath as the plugin uses it heavily.
d
Well, it depends if your library makes high memory pressure or not I usually run tests in 16 threads, and 4g is enough
t
Is there a difference between gradle -Xmx and what the actual compiler gets?
d
For test runtime you need to set
maxHeapSize
property in
Test
task in your build configuration Just passing
-Xmx
to gradle sets it for the process with gradle daemon IIRC
t
Ah, thanks, I'll check that out!
d
Here is how it's done for Kotlin It's over-complicated for your case, but still useful
thank you color 1