Tuesday, 19 May 2015

Increase the Memory in Tomcat

Just add the following contents to the file located in \bin\catalina.bat (for Windows) or \bin\catalina.sh (for unix). Increase the -Xmx... and permGen setting based on your memory capacity and application needs.
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"

Other way of doing is:
Create a file named setenv.bat and place it in %CATALINA_HOME%\bin\
And then add the following content to the file

set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m

Tomcat will execute the file setenv.bat if its there.

No comments:

Post a Comment