Parallel Garbage Collection Fine Tuning

Hello,

I have a cache app running on Red Hat Linux. It's a 2-processor, 4G RAM machine with 2.3 G of RAM assigned to the JVM. I am using the Parallel Collector and have set NewRatio to 4 (it was set to 8 by default) to try to make Minor Collections less frequent, thus deleting more dead objects instead of copying them to the Tenured Generation.

With NewRatio set to 4 it works a bit better (I am going to try setting it to 3 next) but my Tenured Generation is still filling up quite rapidly, in about an hour. I guess this is how it's supposed to work, that the Tenured Generation fills up and then a Major Collection is called. But I have two questions / doubts:

1. My app always waits until less than 300Mb of the 2.3G of memory are full before calling a Major Collection. Can I somehow tell the JVM to do a GC when the Tenured Generation is, say, 60-70% full, instead of almost 90%?

2. Is there any way to actually SEE what data is in the heap? I don't mean a histogram, which tells me the class types, but rather the data itself? The reason I ask is that I see that the heap has more than 1G worth of 'char' objects (seen as '[C' in the histogram), whereas the actual data in our cache, which we store in a ConcurrentHashMap, is less than 1Mb! So it seems the heap is filling up with char's, and I'd love to know WHAT the heck they are.

Perhaps setting NewRatio will make the situation acceptable. After changing it to 4 I have noticed that when a Major Collection is (finally!) performed, it cleans up a lot more than it used to when NewRatio was 8. (Before it would still leave about 1G of the heap occupied, not it only leaves 500Mb).

But this still tells me that the Young Generation should be larger, so that the Minor Collections are performed less frequently, more objects are deleted, less objects are copied to the Tenured Generation, and the heap fills up less frequently.

Any thoughts / ideas?

Thanks!

Bob

[1993 byte] By [syg6a] at [2007-11-27 8:51:55]
# 1
Maybe this will help - http://java.sun.com/developer/technicalArticles/Programming/HPROF.html
thisisvinoda at 2007-7-12 21:06:18 > top of Java-index,Java HotSpot Virtual Machine,Specifications...