Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT increase compilation memory

Tags:

scala

sbt

How can I increase the compilation memory for the project in the build.sbt? Not in the general SBT config.

I want the config to be committed into my Git repo.

Cheers

like image 299
Joan Avatar asked Sep 03 '15 13:09

Joan


People also ask

How can I increase my SBT memory?

Increase Memory for sbt and Maven It is possible to start Maven and sbt with increased memory. We recommend you increase the Maximum Metaspace size and the Thread Stack size. These values can be set using -Xss2M -XX:MaxMetaspaceSize=1024M . The exact values may depend on your hardware and your code base.

What environment variable can you alter to increase the memory Maven uses?

You can start Maven with extra memory using MAVEN_OPTS environment variable.


1 Answers

Create .sbtopts file in root of your SBT project and put in -J-Xmx4G (and similarly -J<JVM option>. Unfortunately, it doesn't seem to work on Windows.

like image 175
Alexey Romanov Avatar answered Oct 04 '22 17:10

Alexey Romanov