How to set heap size for sbt?

前端 未结 10 1173
日久生厌
日久生厌 2020-11-29 17:38

I am using SBT 0.12.0. I have read other answers on stack overflow and followed them, however none of them helps, for example:

  • create ForkRun clas
10条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 17:54

    You need SBT_OPTS, here's what I use in my .bash_profile:

    export SBT_OPTS="-Xmx1536M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M  -Duser.timezone=GMT"
    

    UPDATE: To get your 2G heap space you can use this:

    export SBT_OPTS="-Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M  -Duser.timezone=GMT"
    

    NOTE: SBT MUST BE LATEST VERSION

    Older versions of sbt contain bugs that override these settings, use brew upgrade sbt for latest sbt for Mac (assuming brew install) (IDK for Linux). https://github.com/sbt/sbt/issues/2945#issuecomment-277490848

提交回复
热议问题