You certainly do not want MaxPermSize=8g - The PermSize is for
permanent storage such as class file representation so it's generally
only 256m or less for most people.
Setting -Xmx2g gives you 2GB of heap which may be sufficient (you
generally don't want a heap much bigger than 2GB because of the time
spent doing GC... 3GB tops).
You will want to set -Xms to the same as -Xmx so the heap is
pre-allocated and the JVM doesn't have to deal with growing the heap.
To get more transparency into GC behavior, you need to turn on GC
logging so you can see what's going on. You probably want to ensure
RMI GC doesn't occur too often, select the CMS collector and make any
explicit GCs use that too.
Here's what we're currently using at World Singles:
JAVA_OPTS="-Dsun.rmi.dgc.client.gcInterval=600000
-Dsun.rmi.dgc.server.gcInterval=600000 -Xms2560m -Xmx2560m
-XX:+ExplicitGCInvokesConcurrent -XX:+UseConcMarkSweepGC
-XX:MaxPermSize=512m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
-verbose:gc -Xloggc:${CATALINA_BASE}/logs/gc.log"; export JAVA_OPTS
That's in {tomcat}/bin/setenv.sh along with:
TCHOME=/opt/tomcat
CATALINA_BASE=$TCHOME; export CATALINA_BASE
(just to show what CATALINA_BASE is set to)
Note that Railo requests a full GC every minute so you can either turn
that off (by disabling explicit GC) or make it use CMS as we've done
above.
> What is the max memory that I can assign here?
You say "I have Tomcat set to use 4 GB of RAM" but you don't indicate
how you've done that. Since Tomcat is "just" a Java application, it'll
use whatever Java wants, based on the JVM options you provide (in your
case 2G heap and 8G permsize).
> Does UseCompressedOops make any difference in performance or speed?
I'd never heard of that option so I had to Google it. It doesn't sound
like it's widely available?
http://blog.juma.me.uk/2008/10/14/32-bit-or-64-bit-jvm-how-about-a-hybrid/
"Compressed Oops have been included (but disabled by default) in the
performance release JDK6u6p (requires you to fill a survey)"
So I wouldn't worry about that...
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)