Set tomcat memory heap size

when you are using tomcat as you application server for not small application you can easy get (out of memory exception). this is because the default heap size tomcat use is small and suitable only for small web applications.

to set the start and maximum heap size run the following command before starting your tomcat:

export CATALINA_OPTS=”-Xms1024m -Xmx1024m”

or

export JAVA_OPTS=”-Xms1024m -Xmx1024m”

or

go to the tomcat_HOME/bin/catalina.sh. find the JAVA_OPTS parameter and modify to JAVA_OPTS=”-Xms1024m -Xmx1024m”

this will create environment variable called CATALINA_OPTS  or JAVA_OPTS contains the required options to make tomcat start heap size 1024M and maximum heap size 1024M.

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