Increase Memory Heap Size in Apache Tomcat

Option 1:

Open the catalina.sh script file under $CATALINA_HOME/bin/catalina.sh directory assign it,

export CATALINA_OPTS="-Xms128M -Xmx512M"

 

or simply export,

export CATALINA_OPTS=”-Xms128M -Xmx512MB”

 

The heap size has been set to Minumum 128MB and maximum 512MB

Option 2:

$CATALINA_HOME/bin/setenv.sh

Another option is create a setenv.sh file and add below line,

export CATALINA_OPTS=”${CATALINA_OPTS} -Djava.awt.headless=true -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Xms128m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=950m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled”

 

export CATALINA_OPTS="-Xms128M -Xmx512MB"

You might restart tomcat server,

make sure the memory is increased by

ps aux | grep java

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s