Playframework 2.3.x heap size

Is there a way to set -Xmx when I start the application with "./activator"

I've tried (doesn't work):

./activator start -J-Xmx2g

./activator -mem 2048 start

_JAVA_OPTIONS="-Xmx2g" ./activator  start

      

It says

"Raised _JAVA_OPTIONS: -Xmx2g"

but still doesn't work.

Also tried different values ​​in build.sbt

and application.conf

- no luck

The only way I could get it to work was to use "stage" and pipe -Xmx2g

into the generated shell script, which is fine, but it doesn't separate the console.

I guess I tried everything I found on google but still no luck. I would like to somehow convey -Xmx

to activator start

.

+3


source to share


3 answers


First define an environment variable with JVM options named _JAVA_OPTIONS

export _JAVA_OPTIONS="-Xmx2048m"



and then try play start

or use activator

.

+2


source


I found a solution. There is some bug in the activator shell script, so passing the -J-Xmx argument does not remove the default options. To change the mem parameter, have a look at the activator script (/ usr / local / bin / activator) and see how to add mem parameters. Also note that passing the -v argument will print the final command to java jan. Working linux solution for me:

export JAVA_OPTS="-Xmx2700m";activator -v
# Executing command line:
java
-Dactivator.home=/usr/local/bin
-Xmx2700m
-jar
/usr/local/bin/activator-launch-1.3.2.jar

      

Examples of a broken solution:



_JAVA_OPTIONS="-Xmx2048m";activator -J-Xmx2700m -J-Xms1024m -v
# Executing command line:
java
-Dactivator.home=/usr/local/bin
-Xmx2700m
-Xmx2700m
-Xms1024m
-jar
/usr/local/bin/activator-launch-1.3.2.jar

      

Also doesn't work:

activator -J-Xmx2700m -J-Xms1024m -v
# Executing command line:
java
-Dactivator.home=/usr/local/bin
-Xmx2700m
-Xmx2700m
-Xms1024m
-jar
/usr/local/bin/activator-launch-1.3.2.jar

      

+2


source


I think you need to specify both the minimum and maximum heap size, try this:

activator -J-Xmx2048m -J-Xms2048m start

      

0


source







All Articles