Comment 11 for bug 541520

Revision history for this message
Jason Brittain (jason-brittain) wrote :

Gabriel: It's certainly alright to still discuss this. It's a
complex issue, with (I think) only very rough solutions.

I agree that the JVM authors are saying that if you cannot know
in advance very much about how the Java program is going to be
using the JVM, and if you cannot know about the environment in
which the JVM runs (how much memory hardware is installed, what
kind of CPU or CPUs the JVM is running on, etc) then we should
not make assumptions that can easily be incorrect. The JVM could
inspect some things at startup time (before the program has a
chance to begin running), and can make an educated guess about
which GC algorithm to select based only on the hardware it finds.

But, we actually do know some things that the JVM can't know
before the Java program begins to run. We know that the
application is a web server -- this has very large implications.
The JVM cannot guess something this significant when it is
auto-selecting a GC algorithm during JVM startup. It is true
that not every webapp works the same, so to get the best
performance for your own webapp you have no choice but to
hand-tune the GC. It has always been that way, and still is,
regardless of whether we specify a default GC algorithm or not.
We also chose a default max heap size, which is pretty low (maybe
we could afford a somewhat larger max heap now?). But we know
exactly what it is set to, by default, which also tells us more
about the hardware configuration before startup. If that default
max heap size (still the most coarse tuning knob) is not what the
webapp should have, which will often be the case, then the system
administrator must edit the defaults file and change it.. and
while they're in there they can certainly change the GC algorithm
default if they'd like to. About not knowing which CPU(s) are in
the machine: most CPUs are now multicore, and much of the worry
about single core versus multicore seems to have gone away
because even with a single chip you still have multiple
processors. About the only assumption we're making here is that
we're not trying to choose defaults for old machines. We're
assuming at least single chip, multicore.

As I said in my first comment: Of course we're only talking about
the package defaults and general recommendations, and it is up to
the user to carry out some performance testing to find what works
best for their webapp(s), with their own performance goals in
mind.