I need to configure Tomcat memory settings as part of a larger installation, so manually configuring tomcat with the configuration app after the fact is out of the question. I thought I could just throw the JVM memory settings into the JAVA_OPTS environment variable, but I'm testing that with jconsole to see if it works and it... doesn't.
As per the comment below, CATALINA_OPTS doesn't work either. So far, the only way I can get it to work is via the Tomcat configuration GUI, and that's not an acceptable solution for my problem.
Just edit your your catalina/bin/startup.sh script. Add the following commands in it:
Sailab: http://www.facejar.com/member/page-id-477.html
Serhii's suggestion works and here is some more detail.
If you look in your installation's bin directory you will see catalina.sh or .bat scripts. If you look in these you will see that they run a setenv.sh or setenv.bat script respectively, if it exists, to set environment variables. The relevant environment variables are described in the comments at the top of catalina.sh/bat. To use them create, for example, a file $CATALINA_HOME/bin/setenv.sh with contents
For Windows you will need, in setenv.bat, something like
Hope this helps, Glenn
Not sure that it will be applicable solution for you. But the only way for monitoring tomcat memory settings as well as number of connections etc. that actually works for us is Lambda Probe.
It shows most of informations that we need for Tomcat tunning. We tested it with Tomcat 5.5 and 6.0 and it works fine despite beta status and date of last update in end of 2006.
Handy for linux virtual machines; Use 75% of your total system memory for Tomcat. Yay AWK.
Put at start of "{tomcat}/bin/startup.sh"
I use following
setenv.bat
contents:It also enables debugging and sets debug port to 7777, and appends previous content of
JAVA_OPTS
.If you using Ubuntu 11.10 and apache-tomcat6 (installing from apt-get), you can put this configuration at /usr/share/tomcat6/bin/catalina.sh
After that, you can check your configuration via ps -ef | grep tomcat :)