如何在play / activator中设置堆大小?

时间:2015-01-22 13:42:09

标签: scala sbt typesafe-activator

我得到了一个" java.lang.OutOfMemoryError:Java堆空间"当运行激活器时。我想将堆设置为无限大小。我在其他地方读到了我需要以某种方式更改SBT_OPTS或_JAVA_OPTION:

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

我无法在任何地方找到任何相关文档。

1 个答案:

答案 0 :(得分:17)

tl; dr activator -help

你可以使用JAVA_OPTS(可能影响其他java程序),SBT_OPTS(也影响sbt),ACTIVATOR_OPTS(仅影响激活器),还有-mem -J-Xmx512M 1}}你可以使用的标志。

我认为➜ ~ activator -help Usage: activator <command> [options] Command: ui Start the Activator UI new [name] [template-id] Create a new project with [name] using template [template-id] list-templates Print all available template names -h | -help Print this message Options: -v | -verbose Make this runner chattier -d | -debug Set sbt log level to debug -mem <integer> Set memory options (default: , which is -Xms1024m -Xmx1024m -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=256m) -jvm-debug <port> Turn on JVM debugging, open at the given port. # java version (default: java from PATH, currently java version "1.8.0_25") -java-home <path> Alternate JAVA_HOME # jvm options and output control -Dkey=val Pass -Dkey=val directly to the java runtime -J-X Pass option -X directly to the java runtime (-J is stripped) # environment variables (read from context) JAVA_OPTS Environment variable, if unset uses "" SBT_OPTS Environment variable, if unset uses "" ACTIVATOR_OPTS Environment variable, if unset uses "" In the case of duplicated or conflicting options, the order above shows precedence: environment variables lowest, command line options highest. 也可以。

{{1}}
相关问题