tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Increasing Heap Size and Max Perm Size
Date Wed, 19 Aug 2009 21:30:21 GMT
Daniele Development-ML wrote:
> Found a solution here:
> http://www.coderanch.com/t/85725/Tomcat/heap-space-setting-Tomcat-Linux
> 
> <http://www.coderanch.com/t/85725/Tomcat/heap-space-setting-Tomcat-Linux>Practically,
> everything works when setting the above options through CATALINA_OPTS
> variable.
> 
Daniele,
a solution found here or there may work, and may still be a bad solution 
from an overall point of view.
Modifying catalina.sh means that at the next Tomcat update, it will 
probably be lost, and you will wonder why "something that worked with 
Tomcat 6.0.18 does not work anymore with 6.0.20, but I haven't changed 
anything  !".
The best place to set environment values is the Tomcat/bin/setenv.sh 
(create if not there), which does not get overwritten by a new Tomcat 
version, and is called (if it exists) by catalina.sh, here :

if [ -r "$CATALINA_BASE"/bin/setenv.sh ]; then
   . "$CATALINA_BASE"/bin/setenv.sh
elif [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
   . "$CATALINA_HOME"/bin/setenv.sh
fi

Now, in order to really see what happens, you need, on your platform, to 
look first at the script which starts Tomcat, probably /etc/init.d/tomcatxx.
This script will do some setup, then probably call 
(tomcat_home)/bin/startup.sh, which in turn calls 
Tomcat_home/bin/catalina.sh, which in turn calls 
(tomcat_home)/bin/setenv.sh if it exists.
read those scripts, understand what they are doing and when, and then 
put your environment vars in the right place.
You cannot rely on some receipe written by someone on some forum for 
some particular situation, or on some receipe found in a book that was 
written 5 years ago for a version of Tomcat since unsupported.

There is a standard file in the Tomcat distribution called 
"RUNNING.txt".  On my Debian system, it is in (tomcat_home)/docs. 
Depending on your Linux version, it may have been moved somewhere else.
Regardless, it is a good place to start.
In my Debian distribution, there is also, at the same location, a file 
called README.Debian, which explains in some detail how the Debian 
packager for Tomcat re-organised the Tomcat files, so that they fit 
better in the general Debian host setup logic.
I would assume other distributions do the same.
Read these files, they are full of precise and logical information.

Unless you understand how it all works together, you are condemned to 
re-live the same kind of problems again each time you make a change, 
because you will probably make it in the wrong spot.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message