Setting jvm (CATALINA_OPTS) on yum installed tomcat
My name is Ito and I am an infrastructure engineer.
When Tomcat is installed using yum, catalina.sh is not created and the tomcat daemon is registered.
If you install Tomcat from source instead of yum, you can start and stop it with catalina.sh, so you
can add jvm startup options here.
So what about yum?
Set in tomcat.conf
For Tomcat installed with yum,
various configuration files exist in /etc/tomcat8 (for Tomcat8).
It is OK to specify it here as "CATALINA_OPTS".
# vi /etc/tomcat8/tomcat8.conf CATALINA_OPTS="-Xmx128M -Xms64M"
After setting, restart tomcat and you are done.
tomcat 5785 155 1.6 2618264 131800 ? Sl 07:20 0:04 /usr/bin/java -Xmx128M -Xms64M -classpath :/usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat -juli.jar: -Dcatalina.base=/usr/share/tomcat8 -Dcatalina.home=/usr/share/tomcat8 -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat8/temp - Djava.util.logging.config.file=/usr/share/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start
The contents set in CATALINA_OPTS are reflected as "/usr/bin/java -Xmx128M -Xms64M~~".
If you found this article helpful , please give it a like!