[Bug 541520] Re: Using incorrect JVM Garbage Collector

Gabriel Nell gabriel.nell at gmail.com
Wed Apr 21 20:33:36 BST 2010


The point that "we know something the JVM can't know", eg, that this JVM
is running a web server, is fair. I'm still not convinced that
specifying the CMS collector is the right application of this knowledge,
and I'm new to Ubuntu (from a contributor standpoint, anyway) so I don't
know what the project goals are for the default configuration. But for
now let me move down what I hope is a fruitful path. It sounds like (and
please correct me if I'm wrong) we want to choose settings that:

1) at a minimum, "work" (eg, after running apt-get, tomcat actually boots up and serves requests)
2) has reasonable defaults to suit the sort of hardware we expect people to run web servers on

Currently our defaults are:

-Xmx128M -XX:+UseConcMarkSweepGC

Which satisfies #1, but I still think is not great for #2. Maybe as you
alluded we'd do better by not specifying the maximum heap size? The
rationale was that 64MB is not usually enough, and that made sense under
JDK1.4, when this was the default heap size. However it looks like in
1.5 and later, the heap selection was changed to be based on the amount
of available RAM

***
initial heap size:
Larger of 1/64th of the machine's physical memory on the machine or some reasonable minimum. Before J2SE 5.0, the default initial heap size was a reasonable minimum, which varies by platform. You can override this default using the -Xms command-line option.

maximum heap size:
Smaller of 1/4th of the physical memory or 1GB. Before J2SE 5.0, the default maximum heap size was 64MB. You can override this default using the -Xmx command-line option.
***

So if we don't give any heap parameters to the JVM:

- The heap will be at least 128MB (satisfy goal #1) on any machine with 512MB or more of RAM
- The JVM is free to choose a heap much larger than 128MB, based on the available memory (satisfy goal #2)

For this reason I'd suggest we remove the "-Xmx128M" portion from the
command line.

References:
http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#par_gc.ergonomics.default_size
http://java.sun.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html
http://java.sun.com/docs/hotspot/gc5.0/ergo5.html

-- 
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