« Those pesky "Could not validate SAML Token" exceptions... | Main | Use ANT to speed up custom component development. »

Tuning the Sun HotSpot JVM

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:+UseParallelGC (this is new in J2SE 5 update 6 - it enables multi-threaded garbage collection). Our experience with the 'Parallel Compacting Collector' (-XX:+UseParallelOldGC) and the 'Concurrent Mark-Sweep Collector' (-XX:+UseConcMarkSweepGC) have been bad so far.

* 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.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)