Concurrent GC threads high CPU utilisation
Hello,
We are running Java 1.5.0_07 with "-XX:MaxPermSize=256M XX:+UseConcMarkSweepGC -XX:+OverrideDefaultLibthread" on Solaris 2.8, 4xSPARC CPU, 8GB memory box.
We get random problems with the GC. Sometimes the 4 threads named: "Gang worker#N (Parallel GC Threads)" go into a CPU frenzy (the thread numbers are always 0, 1, 2 and 3, mapped to LWPs 2, 3, 4, 5). When this happens, each of these threads chews up 16-22% CPU. Overall, the java process uses 65-95% CPU. It lasts for about an hour, and drops back to normal, which is about 1-3% for each of these threads, and 8-15% for the whole process.
This hits about once a week, but it is unpredictable. When it hits, it causes trouble for other system that run on the same box.
Does anyone have a clue on this?
Any help would be appreciated.
Laszlo
[843 byte] By [
lazov25a] at [2007-10-3 1:40:50]

These are threads that assist in various GC tasks.
If they are very busy, you are probably getting very frequent GC's.
The additional options -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
should tell you when GC is happening and how much of an overhead
it may be causing.
For GC/Heap tuning advice, point your browser to:
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
Thanks Ramki,
We have found that the default space allocated in the heap for the young generation was much too small. We use a 3 gig heap, on which only 16 meg was allocated to the new generation (all of this went into the eden space - no space could be allocated to the survivor spaces).
Increasing the size of the new generation (now 700 meg - we still may tweak this figure) vastly improved performance. Also the number of garbage collections executed decreased dramatically.