Tomcat - More Memory - CATALINA_OPTS

CATALINA_OPTS or JAVA_OPTS?

CATALINA_OPTS is used to control Tomcat environment options, whereas JAVA_OPTS controls the environment options at a higher level ie. for any Java library.

You can start Tomcat with more heap memory using the following:

On Windows
Edit the file $TOMCAT_HOME\bin\startup.bat and insert or alter the following line, substituting for the desired values:
set CATALINA_OPTS=-Xms(min heap)m -Xmx(max heap)m

For example if you want to allocate a minimum heap size of 256MB and a max heap size of 512MB you will have to write the following on Windows:
set CATALINA_OPTS=-Xms256m -Xmx512m

The line you add should go just before the line starting call “%EXECUTABLE%”…

If you are running tomcat 5.5 via tomcat.exe, you can update the heap size by running tomcatw.exe and setting the required values via the Java tab.

On Linux
Edit the file $TOMCAT_HOME/bin/startup.sh and insert the following line, substituting for the desired value, eg. Bash Shell:
export CATALINA_OPTS=”-Xms(min heap)m -Xmx(max heap)m”

The line you add should go just before the line starting exec “$PRGDIR…

Permanent Generation Size

If you get the error message: java.lang.OutOfMemoryError: PermGen space you need to add the argument -XX:MaxPermSize=128m to CATALINA_OPTS, in addition to any argument you use to set the heap size.

 



This e-mail and any attached files are confidential, proprietary, and may also be legally privileged information, and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient of this e-mail, please send it back to the person who sent it to you and delete the e-mail and any attached files and destroy any copies of it; you may call us immediately at + 91 22 6643 8000 or email us at IT-Security@tatainteractive.com

Tata Interactive Systems and/or any of its sister companies owns no responsibility for the views presented in the e-mail and any attached files unless the sender mentions so, with due authority of Tata Interactive Systems.

Unauthorized reading, reproduction, publication, use, dissemination, forwarding, printing or copying of this e-mail and its attachments is prohibited.

We have checked this message for any known viruses; however we decline any liability, in case of any damage caused by a non-detected virus.

For more details about our company, visit http://www.tatainteractive.com.

Comments

Popular Posts