How to set heap size for sbt?

前端 未结 10 1161
日久生厌
日久生厌 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:53

    In my case, the configuration of my service was overwriting the environment variable SBT_OPTS and JAVA_OPTS. I was able to set the limits by setting in my build.sbt the following:

    javaOptions in Universal ++= Seq(
      "-J-Xms1g",
      "-J-Xmx2g")
    

    Reference: https://www.scala-sbt.org/sbt-native-packager/archetypes/java_app/customize.html

提交回复
热议问题