Increase Memory Heap Size in Apache Tomcat

Option 1:

Open the script file under $CATALINA_HOME/bin/ 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:


Another option is create a 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



Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s