RFR (S): 8019902: G1: Use the average heap size rather than the minimum heap size to calculate the region size
thomas.schatzl at oracle.com
Thu Aug 29 12:28:03 UTC 2013
On Thu, 2013-08-29 at 11:26 +0200, Bengt Rutisson wrote:
> Hi everyone,
> Could I have a couple of reviews of this change:
> The fact that G1 by default bases its region size on the minimum heap
> size means that out of the box the region size will always be 1M. This
> is a problem on large machines with lots of memory. We pick a large heap
> size but get a very small region size. The small regions are inefficient
> and cause a lot of memory footprint. Normally we aim to get around 2048
> regions, but on a machine with a lot of memory we might pick a default
> max heap size of 32G, which means that we will get ~32000 regions. This
> can lead to out of memory situations - especially on Solaris x86.
> This patch changes the heuristics for picking the region size to use the
> average between initial heap size (-Xms) and the maximum heap size
> (-Xmx). This means that for large heaps we will pick larger region
> sizes. In the 32G example we will now pick a region size of 8m which
> means that we will have 4000 regions which is more reasonable.
One minor nit: I do not think that the additional log message in
heapRegion.cpp adds more information than is already printed by other
log messages (PrintGCDetails, PrintFlagsFinal, jcmd, and others).
This would also not require the change that initializes the G1Log
earlier than before.
More information about the hotspot-gc-dev