如何在播放/激活器中设置堆大小? [英] How to set heap size in play/activator?

查看:36
本文介绍了如何在播放/激活器中设置堆大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行激活器时出现java.lang.OutOfMemoryError: Java heap space".我想将堆设置为无限大小.我在其他地方读到我需要像这样更改 SBT_OPTS 或 _JAVA_OPTION :

I get a "java.lang.OutOfMemoryError: Java heap space" when running activator. I would like to set the heap to unlimited size. I read somewhere else that I need to change SBT_OPTS or _JAVA_OPTION somehow like this:

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

我在任何地方都找不到关于此的任何文档.

I could not find any documentation on this anywhere.

推荐答案

tl;dr activator -help

你可以使用JAVA_OPTS(可能影响其他java程序)、SBT_OPTS(也影响sbt)、ACTIVATOR_OPTS(只影响activator)和您还可以使用 -mem 标志.

You can use JAVA_OPTS (may affect other java programs), SBT_OPTS (also affects sbt), ACTIVATOR_OPTS (only affects activator) and there's also a -mem flag you can use.

我认为 -J-Xmx512M 也可以.

➜  ~ 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.

这篇关于如何在播放/激活器中设置堆大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆