Hi Sandra,
I’m not quite sure what you’ve got in your setenv file, but for some reason the –X options are being interpreted as separate commands, not as part of setting a variable value. I think you may have gotten the text that needs to be set in the Windows service
configuration, where each value is on a separate line. In your setenv.sh, it should all be on a single line:
CATALINA_OPTS=$CATALINA_OPTS -Xms512m -Xmx1024m -XX:MaxPermSize=256m
If you change this and still have trouble, please send the setenv.sh file along with your response so I can have a look at that as well.
Regardless, my preference for setting this is to modify the Tomcat configuration file. Where this file is located depends on the operating system, but basically for Debian flavors of Linux (Debian and Ubuntu mostly, but
there are others), the file you’re interested in is /etc/default/tomcatX (where X is 6 or 7). In that file, I have the following settings for my development server:
JAVA_OPTS="-Djava.awt.headless=true
-Xms542m -Xmx1g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow"
JAVA_OPTS="${JAVA_OPTS}
-XX:MaxPermSize=512m -XX:+CMSIncrementalMode -XX:+CMSClassUnloadingEnabled"
On Fedora/RHEL-based distributions (Fedora, RHEL, CentOS, Scientific Linux, the file you’re interested in is /usr/share/tomcatX/conf/tomcatX.conf or /etc/tomcatX/tomcatX.conf (these are the same file: /usr/share/tomcatX/conf
is actually a symlink to /etc/tomcatX). Our development servers here in the lab have the following settings:
JAVA_OPTS="-Xms436m -Xmx1310m -Xmn262m -XX:-OmitStackTraceInFastThrow
-XX:MaxPermSize=256m -Dsun.net.inetaddr.ttl=30"
You want to be careful about setting the MaxPermSize too high: it’s a complex topic but basically if it’s too low you can’t allocate enough objects, but if it’s too high garbage collection doesn’t happen often enough and
performance can suffer.
One other thing I see is that your error messages show the –Xms and –XX:MaxPermSize options, but the –Xmx option is probably the more important one, since that sets the maximum allowable heap size, which is the available
RAM to the JVM for processing. But your error is specifically about PermGen, so the MaxPermSize option is the relevant one here.
--
Rick Herrick
Sr. Programmer/Analyst
Neuroinformatics Research Group
Washington University School of Medicine
(314) 740-5961