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 tried, and they do not seem to take effect: 1) Adding the parameter "jvm.memory = -Xmx1024M -Xms2048M" to conf / application.conf 2) Or follow the instructions in PlayFramework - ProductionConfiguration, by typing start -Xms128M -Xmx512m-server http://www.playframework.com/documentation/2.1.2/ProductionConfiguration

How do we control if heap size has been increased? Using the Windows task manager, we monitor whether the fixed size has increased (or are we doing something wrong?)

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

Thank you for your help!

+6
source share
3 answers

When you start the application with a phased run of the script, you can directly attach jvm args. For instance:

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

This will cause gc logs to print to gc.log. So that you can check if the heap size is really allocated.

+3
source

To configure a bunch of Java on UNIX, run them before running dsp:

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

run the script file.

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

works up to version 2.5.x

Link

0
source

Source: https://habr.com/ru/post/953748/


All Articles