[2.2.1] Setting JVM arguments -Xmx and Xms for "play run"

588 views
Skip to first unread message

Ömer Faruk Gül

unread,
Feb 25, 2014, 7:04:40 AM2/25/14
to play-fr...@googlegroups.com
Hi,

I'm trying to set Xmx and Xms for play run but I failed after trying the following two methods (I'm using VisualVM to check it under "JVM arguments" tab):

play run - Xmx384m

and also inside the build.sbt file:

javaOptions ++= Seq("-Xms64M", "-Xmx384M")

What's the correct way of setting this?

Joe Zulli

unread,
Feb 25, 2014, 6:25:40 PM2/25/14
to play-fr...@googlegroups.com
The simplest way that I know of for setting those values in a dev environment is with the _JAVA_OPTIONS environment variable. for example, I have the following in my .bashrc:

export _JAVA_OPTIONS="-Xms64m -Xmx1024m -Xss2m -XX:MaxPermSize=256m"


Joe

Alberto Souza

unread,
Feb 26, 2014, 6:09:54 PM2/26/14
to play-fr...@googlegroups.com
You could use env JAVA_OPTS="-Xmx1g -Xms1g" play run

Ömer Faruk Gül

unread,
Feb 27, 2014, 5:36:51 AM2/27/14
to play-fr...@googlegroups.com
I set the JAVA_OPTS and now arguments are set correctly but the problem is,  Xmx and Xms values are passed two times, here is the list of JV arguments:

-Xms512M
-Xmx1536M
-Xss1M
-XX:ReservedCodeCacheSize=192m
-XX:+CMSClassUnloadingEnabled
-XX:MaxPermSize=512M
-Xms64m
-Xmx384m
-Xss512k
-Dfile.encoding=UTF-8
-Dplay.version=2.2.1
-Dplay.home=../../Frameworks/play-2.2.1/framework
-Dsbt.boot.properties=../../Frameworks/play-2.2.1/framework/sbt/sbt.boot.properties

When I monitor the heap, it looks like it is obeyed to Xmx384m. But where is the -Xmx1536M and -Xms512M default arguments are passed and is there a way I can remove them?

Alberto Souza

unread,
Feb 27, 2014, 1:51:41 PM2/27/14
to play-fr...@googlegroups.com
I am not sure. I did not find any information about that... But it is not a problem... the last arguments are more important :).
Reply all
Reply to author
Forward
0 new messages