Tuning the Sun HotSpot JVM

| No Comments

If you have Adobe LiveCycle ES running on JBoss using Sun's HotSpot JDK, the following tuning ideas might help:

* run the JVM in server mode (using the -server JIT compiler) with -server (slower startup, faster runtime performance)

* enable the 'Parallel (Throughput) Garbage Collector' with --XX:+UseParallelOldGC (this is new in J2SE 5 update 6 - it enables multi-threaded garbage collection). Our experience with the 'Concurrent Mark-Sweep Collector' (-XX:+UseConcMarkSweepGC) and the Serial Collector (-XX:UseSerialGC) have not been great.

* Configure garbage collector threads to the number of CPU cores available (n) with:
-XX:ParallelGCThreads=n

* Set both the minimum as well as the maximum heap size to 1 GB with:
-Xms1024m -Xmx1024m This is very important in Windows. The JVM requires contiguous memory for its heap. If it grabs all of the heap it needs right at startup when RAM is not highly fragmented, you can prevent potential OutOfMemoryExceptions later on.

* Set the size of the minimum and maximum 'Permanent Generation' to 256 MB with:
-XX:PermSize=256m -XX:MaxPermSize=256m

* Prevent the garbage-collection of classes when no instances of them are left with:
-Xnoclassgc. This option is a little risky, test thoroughly before applying into production use.

* On Windows, use large memory pages with -XX:+UseLargePages. To do this, you also need to give the user whose authorization JBoss uses to run, the User Right to "Lock pages In Memory". You can do this using Group Policy Editor (gpedit.msc). This option is a little risky, JBoss might have trouble coming up.

For a comprehensive list of options for the Sun HotSpot JVM, please see this.

Leave a comment

About this Entry

This page contains a single entry by Jayan Kandathil published on October 12, 2007 2:50 PM.

Those pesky "Could not validate SAML Token" exceptions... was the previous entry in this blog.

Use ANT to speed up custom component development. is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.