[Bug 541520] Re: Using incorrect JVM Garbage Collector

Gabriel Nell gabriel.nell at gmail.com
Tue Apr 20 22:52:48 BST 2010


Folks -- sorry for chiming in here after the train has apparently left
the station :)

I've been working on optimizing my Tomcat configuration for the past
couple days, and this optimization has mostly centered around the
garbage collector. I'm concerned that specifying the CMS collector is
classic premature optimization. If I absorbed this change, my
application performance would have gotten suddenly worse. But let's not
talk about my specific case.

To excerpt from the same whitepaper referenced above (section 6, first
paragraph):

"Thus, the initial recommendation for selecting and configuring a
garbage collector is to do nothing! That is, do not specify usage of a
particular garbage collector, etc. Let the system make automatic choices
based on the platform and operating system on which your application is
running."

As this implies, the Hotspot JVM will actually select a collector for
you based on the system resources. Further, Sun's GC tuning document
found at

http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#available_collectors.selecting

Advises that heap size should actually be the first knob you adjust
before switching collectors.

I'm all for choosing smart defaults. But I think in this case the advice
from the guys who make Java is pretty clear. Let the JVM decide, and if
it's not good enough, only then optimize for the metrics you care about,
and do not begin by choosing a specific collector.

-- 
Using incorrect JVM Garbage Collector
https://bugs.launchpad.net/bugs/541520
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to tomcat6 in ubuntu.



More information about the Ubuntu-server-bugs mailing list