We use SBT 0.13 and Java 8 JVM for CircleCI to create a Play application with several subprojects. Sometimes we ran into memory problems at CircleCI, where it interrupted our build because it exceeded 4 GB of memory usage.
Yesterday I added a new subproject to our assembly, and almost all assemblies fail due to a memory problem. It seems that adding subprojects also increases the amount of memory used for our build.
I tried a few things to reduce the memory load:
- Add
_JAVA_OPTIONS: "-Xms512m -Xmx2048" to circle.yml , as described in the CircleCI Documentation Pages . (I noticed from the journal that the JVM really selects this option.) - Add the
-mem to the SBT call. - Add
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1) to the top of the SBT file to make sure that at least the memory is not used all at once.
All these measures seem to have helped, but I have not yet found a final solution to this problem.
What else can I do to keep SBT memory usage under control?
EDIT . Our project has 5 subprojects: about 14,000 lines of Scala code (as well as 21,000 lines of Java code that we โinheritedโ). External memory usually (but not always) occurs when performing static analysis using FindBugs: we use this together with the FindSecurityBugs plugin to find security problems.
scala out-of-memory sbt
jqno
source share