JVM Tuning... getting rid of SawTooth in the memory graph.
843829Apr 12 2006 — edited Apr 25 2006Hi,
I am currently investigating high CPU usage in my application. During certain times of the day the App sends out thousands of mails to the users. And during these peak times, the CPU usage is very high.
In the course of this, I was monitoring the Weblogic server using the Admin Console's Performance Monitor. The memory graph on the console shows a "Sawtooth" pattern. This is clearly indicative of multiple GCs happening.
On turning on the PrintGCDetails options, I noticed that almost all of the GCs happening during this peak time were Minor GCs. This is understandable, since there are so many short lived objects created during the peak time.
My total Heap size is 2GB. The NewGen size is set at 900MB. A part of the verbose GC output is something like below. The entire GC is very similar to this.
[GC {Heap before GC invocations=153:
Heap
par new generation total 894528K, used 882393K [0x71400000, 0xa9800000, 0xa9800000)
eden space 867456K, 100% used [0x71400000, 0xa6320000, 0xa6320000)
from space 27072K, 55% used [0xa7d90000, 0xa8c26730, 0xa9800000)
to space 27072K, 0% used [0xa6320000, 0xa6320000, 0xa7d90000)
tenured generation total 1175552K, used 257597K [0xa9800000, 0xf1400000, 0xf1400000)
the space 1175552K, 21% used [0xa9800000, 0xb938f768, 0xb938f800, 0xf1400000)
compacting perm gen total 36608K, used 36551K [0xf1400000, 0xf37c0000, 0xf9400000)
the space 36608K, 99% used [0xf1400000, 0xf37b1d08, 0xf37b1e00, 0xf37c0000)
[ParNew
: [b]882393K->15018K(894528K), 0.0554919 secs] 1139991K->274086K(2070080K) Heap after GC invocations=154:
Heap
par new generation total 894528K, used 15018K [0x71400000, 0xa9800000, 0xa9800000)
eden space 867456K, 0% used [0x71400000, 0x71400000, 0xa6320000)
from space 27072K, 55% used [0xa6320000, 0xa71ca9b8, 0xa7d90000)
to space 27072K, 0% used [0xa7d90000, 0xa7d90000, 0xa9800000)
tenured generation total 1175552K, used 259067K [0xa9800000, 0xf1400000, 0xf1400000)
the space 1175552K, 22% used [0xa9800000, 0xb94fef10, 0xb94ff000, 0xf1400000)
compacting perm gen total 36608K, used 36551K [0xf1400000, 0xf37c0000, 0xf9400000)
the space 36608K, 99% used [0xf1400000, 0xf37b1d08, 0xf37b1e00, 0xf37c0000)
} , 0.0561965 secs]
[GC {Heap before GC invocations=154:
Heap
par new generation total 894528K, used 882474K [0x71400000, 0xa9800000, 0xa9800000)
eden space 867456K, 100% used [0x71400000, 0xa6320000, 0xa6320000)
from space 27072K, 55% used [0xa6320000, 0xa71ca9b8, 0xa7d90000)
to space 27072K, 0% used [0xa7d90000, 0xa7d90000, 0xa9800000)
tenured generation total 1175552K, used 259067K [0xa9800000, 0xf1400000, 0xf1400000)
the space 1175552K, 22% used [0xa9800000, 0xb94fef10, 0xb94ff000, 0xf1400000)
compacting perm gen total 36608K, used 36551K [0xf1400000, 0xf37c0000, 0xf9400000)
the space 36608K, 99% used [0xf1400000, 0xf37b1d08, 0xf37b1e00, 0xf37c0000)
[ParNew: [b]882474K->14359K(894528K), 0.0515177 secs] 1141542K->275034K(2070080K) Heap after GC invocations=155:
Heap
par new generation total 894528K, used 14359K [0x71400000, 0xa9800000, 0xa9800000)
eden space 867456K, 0% used [0x71400000, 0x71400000, 0xa6320000)
from space 27072K, 53% used [0xa7d90000, 0xa8b95f00, 0xa9800000)
to space 27072K, 0% used [0xa6320000, 0xa6320000, 0xa7d90000)
tenured generation total 1175552K, used 260674K [0xa9800000, 0xf1400000, 0xf1400000)
the space 1175552K, 22% used [0xa9800000, 0xb9690b00, 0xb9690c00, 0xf1400000)
compacting perm gen total 36608K, used 36551K [0xf1400000, 0xf37c0000, 0xf9400000)
the space 36608K, 99% used [0xf1400000, 0xf37b1d08, 0xf37b1e00, 0xf37c0000)
} , 0.0523295 secs]
I am noticing that almost the entire NewGen is garbage is is getting cleaned out during every Minor GC.
OS: Solaris 8 CPU: 2 JVM: Java1.4.2.01 Hotspot.
Now my goal is to avoid this huge number of GCs happening at the peak time, thereby reducing the CPU consumption. Or simply I want to rid the CPU of the GC overhead.
I read through and tried various GC tuning techniques. I have tried the NewParGC, ParallelGC, used the ConcMarkSweep option along with NewParGC etc. I have basically tried various GC methods to try and get the low CPU usage by GC(so that CPU can be used by my application).
But there was no success.
I am posting this here, in the hope that some of you could guide me from here. What should I do. Am I missing something. Could I increase my NewSize more than the current 900MB?
Please do show me the way from here.
THanx