Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 590
luxcan Avatar asked Sep 13 '13 04:09

luxcan


People also ask

How do I increase my IAPS heap size?

Under the DTM Properties, there is an option JVMOption1 (if JVMOption1 is already populated, use JVMOption2 and so on). Enter the value -Xmx2048m. Click on SAVE to save the changes. Once the changes are saved, a new version of Data Integration Server is triggered.

How much heap size we can increase?

Maximum heap size is 1/4th of the computer's physical memory or 1 GB (whichever is smaller) by default. The maximum heap size can be overridden using -Xmx.

Is there a limit to heap size?

The default startup heap size is 1.5 GB. This value must be a number between 1.5 GB and the maximum amount of memory allowed by your operating system and JVM version. Consider the following examples: If you have a Windows system with a 32-bit JVM, then a process can have a maximum heap size of 2 GB.


2 Answers

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.

like image 107
user556698 Avatar answered Oct 02 '22 19:10

user556698


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.

like image 20
Max Avatar answered Oct 02 '22 19:10

Max