How to Increase Heap Size in Play Framework 2.1?
Asked Answered
D

3

8

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!

Deltoid answered 13/9, 2013 at 4:55 Comment(1)
Check this:#6763953 maybe it will helpSupremacy
R
3

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.

Rumrunner answered 15/9, 2013 at 3:7 Comment(2)
throwing: Bad root server path: /home/rajat/projects/coreservice/target/universal/stage/-Xmx2gQuantize
@Rajat To pass arguments to JVM you should prepend them with -J-. For example, ./target/start -J-Xmx1g.Joann
F
4

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.

Farahfarand answered 7/12, 2013 at 11:32 Comment(0)
R
3

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.

Rumrunner answered 15/9, 2013 at 3:7 Comment(2)
throwing: Bad root server path: /home/rajat/projects/coreservice/target/universal/stage/-Xmx2gQuantize
@Rajat To pass arguments to JVM you should prepend them with -J-. For example, ./target/start -J-Xmx1g.Joann
Q
1
[PROJECT_ROOT_DIR]/target/universal/stage/bin/[BASH_SCRIPT] -J-Xmx 4G

works on till 2.5.x version

Reference

Quantize answered 12/7, 2019 at 13:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.