I am trying to increase the memory for my JVM heap and permgen on my Tomcat 6 server. I was getting out of memory errors whenever I tried to run a second webapp. I am very new at this, but to my understanding the method is to put your JVM startup switch settings in the JAVA_OPTS variable. This is my switch:
Your change to /etc/bash.bashrc should work if you add
export CATALINA_OPTS="..."
Without “export” the variable will not be visible. If you, or any other user, are starting/stopping tomcat then ~/.bashrc is a better place in my opinion.
Just one more note, you can “quickly” test a setup by running tomcat with the command
$> CATALINA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=512m" catalina.sh run
or
$> export CATALINA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=512m"
$> catalina.sh run
Really, please explain? How would this work with multiple tomcat instances running on the same host with different CATALINA_OPTS? Making the changes in catalina.sh seems valid, this way you isolate it to the given tomcat instance.
Its just my general policy of not customizing installed files.
Anyway, tomcat provides many options to override settings without editing the default files. Look for the CATALINA_BASE property. It allows you to have a single installation and multiple configurations (server.xml, webapps, etc).