Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set heap size in play/activator?

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.

like image 428
eaglefreeman Avatar asked Jan 22 '15 13:01

eaglefreeman


People also ask

How do I increase my IAPS heap size?

In the Edit Page, Under System Configuration Details, Select the Service as Data Integration Server from drop down and select Type as DTM. Under the DTM Properties, there is an option JVMOption1 (if JVMOption1 is already populated, use JVMOption2 and so on). Enter the value -Xmx2048m. Click on SAVE to save the changes.

What is heap size in JMeter?

By default JMeter runs with a heap of 1 GB, this might not be enough for your test and depends on your test plan and number of threads you want to run.


1 Answers

tl;dr activator -help

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.

I think -J-Xmx512M would also work.

➜  ~ 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.
like image 64
Havoc P Avatar answered Oct 19 '22 03:10

Havoc P