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. I will update this post if I add more.
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.
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.
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:
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.
Use this setting if you have a 64-bit JVM. This will help to reduce the memory footprint of the JVM.