HOW TO - JVM Tuning for Content Server

Now I'm not a java developer (I'm actually not any kind of developer, and I'm especially not a java developer); but I have spent a lot of time tuning the JVM in various different server environments.

In fact, I'm on an architectural review engagement this week and JRE tuning is almost always a good place to start.

So why, oh why, is the documentation on this subject so hard to find and and so difficult to parse when you do find it? Is the assumption that only nerd-core java guys would ever want to set JAVA_OPTIONS? You'd think it would be easy to find a defnition of the correct syntax for setting environment variables to tune the JRE - you'd be wrong. (See this for an example)

Anyway, in the course of digging into this I did find some good info and in the spirit of sharing and kharma generation I'll pass it on.

Have you ever wondered why there's no hard and fast upper limit on the heap size for the JVM in windows? Well, it's because the JVM needs contiguous memory space for the heap and even windows systems with lots of RAM don't assign large blocks of RAM. The fuller / better explanation is here. I have found it very rare to be able to assign a heap larger than 1GB on windows, although some people have got the max up to 1.5GB. Either way, it can't be more than 75-80% of free RAM and these numbers are still <1/2 of what you can achieve on a Solaris system with enogh RAM.

FWIW, the syntax for setting this is JAVA_OPTIONS=-Xmx1024m -Xms1024m (I like to set the max and min to be the same to prevent fragmenation). You set this in intradoc.cfg, NOT in config.cfg.

There are also garbage collection options that can be very useful on Solaris and I can cover them in another post. I've never seen any benefit on a windows box from using them.

I'm also hearing great things from Chris Rothwell about using JRockit as a JVM rather than the Sun JVM provided with the install. I'll follow up on this more as I get a chance to explore it.

Comments:

Thanks Raoul.. I look forward to reading the next post!! ;) Hopefully you can tell us that JRockit on Windows can improve on the heap size somehow...

Posted by John Sim on October 08, 2008 at 04:44 PM CDT #

I like your post thank you

Posted by ruben on December 10, 2009 at 01:29 AM CST #

Post a Comment:
Comments are closed for this entry.
About

Enterprise 2.0 and Content Management

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today