Smaller young generations get collected more often, which means that objects will more
quickly use up their 32 (by default) lives before being placed into into the tenured
generation. Thus medium-lived objects tend to end up in the tenured generation. By keeping
your young generation larger, you are more apt to "kill" medium-lived objects
via a minor collections because there are fewer of them.
In one test (on a real-world application, not on a test app) I saw the number of
collections go from over 8000 to under 100 by right-sizing the young generation. The total
time spent in GC was also drastically reduced from several minutes to under one minute.
Both size and number of live objects are factors in GC time. Larger heaps take longer to
collect. Given two heaps of the same size, the one with the most number of live objects
takes the longest to collect.
Parallel collection helps, given one CPU/core per thread. Fortunately, parallel collection
is turned on by default starting with JVM 1.5 if you have two CPUs/cores and at least 1GB
or RAM (yes RAM, not heap size).
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172349#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...