Tomcat - JVM Arguments (setenv.sh)

by
Jeremy Canfield |
Updated: October 21 2021
| Tomcat articles
The most common way to change the startup/runtime settings for a Tomcat application server is to create the setenv.sh file at <tomcat home>/bin/setenv.sh.
touch /opt/tomcat/bin/setenv.sh
And to then append options to setenv.sh. In this example, the heap size is set to 512 MB.
JAVA_OPTS="-Xms512m -Xmx512m"
Restart Tomcat for this change to take effect.
/opt/tomcat/bin/shutdown.sh
/opt/tomcat/bin/startup.sh
The ps command can be used to confirm that Tomcat is using the options listed in setenv.sh.
ps -ef | grep -i tomcat
Did you find this article helpful?
If so, consider buying me a coffee over at