luxcan
luxcan

Reputation: 95

How to Increase Heap Size in Play Framework 2.1?

Is there a way to increase heap size for Play Framework 2.1?

Below are some of the actions we have tried and it doesn't seems to take into effects: 1) Adding a "jvm.memory=-Xmx1024M -Xms2048M" parameter in conf/application.conf 2) Or follow the instruction in PlayFramework - ProductionConfiguration by typing start -Xms128M -Xmx512m -server http://www.playframework.com/documentation/2.1.2/ProductionConfiguration

How do we monitor if the heap size has been increased? Using Windows Task Manager, we monitor if the committed size has been increase (or are we doing the wrong thing?)

Edited[13/9/13]: We edit the xmx and xms parameter at play2/framework/build.bat file and it works. Is this the proper way to do it? Also any recommended value that you guys are currently using in the production?

Thanks for your help!

Upvotes: 8

Views: 7391

Answers (3)

Rajat Verma
Rajat Verma

Reputation: 2590

[PROJECT_ROOT_DIR]/target/universal/stage/bin/[BASH_SCRIPT] -J-Xmx 4G

works on till 2.5.x version

Reference

Upvotes: 1

user556698
user556698

Reputation: 65

To configure the Java Heap in UNIX environment, run these before starting dsp:

export JAVA_MIN_MEM=2048M
export JAVA_MAX_MEM=4128M
export JAVA_PERM_MEM=256M

start your script file.

Upvotes: 4

Max
Max

Reputation: 2095

When starting your application with staged start script, you can append jvm args directly. For example:

./target/start -Xms1g -Xmx2g -Xloggc:gc.log -verbose:gc -XX:+PrintGCDateStamps -server -Dhttp.port=24000 &

This will print gc logs to gc.log as well. So that you can verify whether heap size is really allocated.

Upvotes: 3

Related Questions