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:
ForkRun clas
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