Garbage collection tuning on AIX

On the last AIX IBM JVM (1.5), the default garbage collection algorithm is the “Mark and Sweep” algorithm.

On a current project, running a web application on JBoss, I had some performance issues. The CPU usage was abnormally high. Even during low load (during the night), the Java process was using neatly 20% of the CPU.

After analysis of garnage collection trace output, I found out that the garbage collection was running every 10-12 sec ans was taking bout 1.2s. From those 1.2 sec, about 1.1sec was used by the mark phase. The IBM Pattern Modeling and Analysis tool shows an overall garbage collection overhead of 9%.

I tried different garbage collection policies and finally I found out that the “gencon” policy seems to be the best in our case. The overal garbage collection overhead falls below 2% and the avarage CPU usage drops by more than 15%.

My explanation is that there was a high amount of long life objects – even really long life object, maybe the connection pools. At every run, the Mark and Sweep algorithm had to mark every object and that phase was highly time consuming. The generational algorithm (the “gencon” policy) didn’t process the long life objects until it the old heap size is exceeded (in my case, once every 10 min). So the number of objects to process at each GC run was smaller and the garbage collection was running more quickly.

I just have still one question, in which case would the default setting (the mark and sweep algorithm) be suitable for a server application?

Comments are closed.