I’ve got a multi-platform multi-project build in Kotlin, and it seems that for CI I have to give the docker container a lot of memory (8G+) to work. When it’s set to 2G the build runs very slowly (probably memory swapping?) and eventually fails.
In most cases I’m fine with just increasing the container’s memory, but for my own education I’d like to know if there are settings I should try.
Things I’ve tried:
- playing with the jvm args heap size org.gradle.jvmargs
- -XX:+UseContainerSupport -XX:MaxRAMPercentage=80
- Setting kotlin compiler daemon options (-Dkotlin.daemon.jvm.options=-Xmx##) (Although it doesn’t always fail on compilation, could be during tests or other build steps)
I should mention that I don’t have a keen sense of what is “normal” here. 8GB might be normal for a project this size, but my gut is telling me something is probably wrong, especially considering that any individual project will compile fine, but as a whole in the multi-project build it will fail after a few minutes.
Perhaps a memory leak in the build that I don’t know how to troubleshoot.
Any advice is appreciated