Can't set memory settings for `sbt start`

本秂侑毒 提交于 2019-12-05 03:36:28

Also struggled with setting jvm memory args for sbt on Linux in the past (on Windows you can tweak sbtconfig.txt but this and all other places where you can specify SBT_OPTS I could find doesn't work on Linux for some reason).

Last time I've solved this by using -mem <amount> option of sbt itself.

So, in your case you should try something like this:

$ sbt -mem 512 start

I had the same problem today with EC2 nano-instance. Solved it this way:

cd /etc/sbt-launcher-packaging/ 
sudo nano sbtopts

Then uncomment -mem option. I've set it to 256 and after that I can normally run sbt on nano-instance. A sample piece of this config file after edited:

# Path to local Ivy repository (default: ~/.ivy2)
#
#-ivy ~/.ivy2

# set memory options
#
-mem   256

# Use local caches for projects, no sharing.
#
#-no-share
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!