X

Best Practices from Oracle Development's A‑Team

Recommended JVM parameters for 11g products

Mark Nelson
Architect

Introduction

In this post, I will discuss some of the common JVM tuning & diagnostic parameters.

Main Article

I often get asked to recommend some JVM parameters for people running one (or more) of the Oracle Fusion Middleware 11g products – like BPM, SOA, UCM, WebCenter, etc. on top of WebLogic Server.

Here are my current list of recommended settings and why I like them.

-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-Xloggc:gc.log
These three settings will cause the JVM to print out more detailed information about garbage collection and to produce a log (called gc.log in this example) that contains garbage collection statistics and information that is very useful when trying to do some JVM tuning.

-Xms2048m
-Xmx2048m
These two settings control the size of the Heap.  I like to always make them the same value (2048m in this example – you need to put in the right value for your system, not just copy this one).  Making them the same size means the JVM will not spend time trying to work out if it needs to increase the size of the heap.  Changing the heap size is a very expensive operation, and if there were a large difference between these two settings, it could happen quite a few times before the heap reaches its maximum size.

-XX:+HeapDumpOnOutOfMemoryError
This one will cause the JVM to take a heap dump if (in a development environment I might say “when”) you get an OutOfMemoryException.  This is really useful to work out what caused the problem.  If you don’t have this turned on when your JVM crashes, you will need to wait for it to happen again before you can capture some dumps.  Having in turned on just in case is a good idea.

For HotSpot only:
-XX:PermSize=512m
-XX:MaxPermSize=512m
These two control the size of the Permanent Generation (one of the memory areas used by the HotSpot JVM).  Like the heap size, I like to make them the same, for the much the same reason.  If you get an OutOfMemory: PermGen error in your log, it is telling you you don’t have enough memory in this space.  Again, you need to put in the right value for your system, not just copy this one.

-XX:+UseCompressedOops
Use this setting if you have a 64-bit JVM.  This will help to reduce the memory footprint of the JVM.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha