« Berkeley DB Java Edition: DZone Refcardz Cheat Sheet | Main | Berkeley DB Java Edition: IOException "Incorrect function" on Windows 7 »

Berkeley DB Java Edition FAQ Entry on GC Params for Large Caches

I've added a new entry to the BDB JE FAQ regarding JVM parameters for large cache sizes.

Here's the text of it:

What JVM parameters should I consider when tuning an application with a large cache size?

If your application has a large cache size, tuning the Java GC may be necessary. You will almost certainly be using a 64b JVM (i.e. -d64), the -server option, and setting your heap and stack sizes with -Xmx and -Xms. Be sure that you don't set the cache size too close to the heap size so that your application has plenty of room for its data and to avoided excessive full GC's. We have found that the Concurrent Mark Sweep GC is generally the best in this environment since it yields more predictable GC results. This can be enabled with -XX:+UseConcMarkSweepGC.

Best practices dictates that you disable System.gc() calls with -XX:-DisableExplicitGC.

Other JVM options which may prove useful are -XX:NewSize (start with 512m or 1024m as a value), -XX:MaxNewSize (try 1024m as a value), and -XX:CMSInitiatingOccupancyFraction=55. NewSize is typically tuned in relationship to the overall heap size so if you specify this parameter you will also need to provide a -Xmx value. A convenient way of specifying this in relative terms is to use -XX:NewRatio. The values we've suggested are only starting points. The actual values will vary depending on the runtime characteristics of the application.

You may also want to refer to the following articles:

* Java SE 6 HotSpot Virtual Machine Garbage Collection Tuning
* The most complete list of -XX options for Java 6 JVM
* My Favorite Hotspot JVM Flags

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

About This Entry

This page contains a single entry from the blog posted on September 2, 2009 2:38 PM.

The previous post in this blog was Berkeley DB Java Edition: DZone Refcardz Cheat Sheet.

The next post in this blog is Berkeley DB Java Edition: IOException "Incorrect function" on Windows 7.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle