I'm looking for some advice as to how I should set the JVM memory size parameters (-Xmx and -Xms) when starting JBoss.
My JBoss server is running on a REdHat Linux installation and is basically the only thing running on the box with 12gig ram, other than the OS and a few network services.
Jboss:- JBoss 4.0.2 and jdk1.4
OS : Redhat4
DataBase :- Oracle10g RAC
user login : 80
How to increase the heap size upto 5 or 10gig ?
I would advise against setting the heap to 5GB (or 10GB), because when you hit your first major garbage collection, you will find that it will take several minutes during which time all of the application processing will be suspended. (If you have multiple CPUs, you could look into the mostly-concurrent garbage collector, which would reduce the delay for garbage collection, and thus might allow a fairly large heap to be used. Note that this collector will slow down the overall throughput for the application.)
The best setting is to make the heap as large as you need it, but not any larger. The only way to find out what this ideal heap size is is to perform load testing on your application. I usually recommend the following setting to start your testing with, and then to adjust the setting based on usage:
-Xms1200M -Xmx1200m -XX:NewSize=300M -XX:MaxNewSize=300M
To analyze the heap usage, use the -verbose:gc or -XX:PrintHeapAtGC command line options, plotting the data that they give. That will tell you if you need to adjust the young generation or whole heap sizes.