Code Review Request: 6819085 G1: use larger and/or user settable region size

Vikram A vikram.account at
Thu Jul 30 20:12:50 PDT 2009

hi Tony,

Just thinking out loud here.

You had once outlined  that we get most benefit with 1MB regions based
on your testing.

 in arguments.cpp

+   uintx region_size = G1HeapRegionSize;
+   if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
+     // We base the automatic calculation on the min heap size. This
+     // can be problematic if the spread between min and max is quite
+     // wide, imagine -Xms128m -Xmx32g. But, if we decided it based on
+     // the max size, the region size might be way too small for the
+     // min size. Either way, some users might have to set the region
+     // size manually for some -Xms / -Xmx combos.
+     region_size = min_heap_size() / TARGET_REGION_NUMBER;
+   }

with this for many small application it seems to me that the region
size is disturbed.

eg. in the above doc. you mention
-Xms128, consider the heap to be  and TARGET_REGION_NUMBER is defined as 2048.
So, total heap will be
128 * 1024(K) = 131072K
now dividing 131072K/2048 = 64K for each region.

If this inpterpretation is right and there is a reason for doing it
this way, aren't we losing the adv we gained with 1024K region.
this seems like a very small region size and would induce frequent GC,
although could be with small pause time.

I would assume that many enterprise would run their java with larger
heaps than this, but considering this is also for every one, should
the 1024K region size be useful to keep by default while allowing this
fix to modify it for advanced user.

Like I said just my thoughts.


On Fri, Jul 31, 2009 at 2:51 AM, Tony Printezis
<Antonios.Printezis at> wrote:
> The idea is to allow the user to set the region size with a parameter (-XX:G1HeapRegionSize=N).
> Tony
> --
> ----------------------------------------------------------------------
> | Tony Printezis, Staff Engineer    | Sun Microsystems Inc.          |
> |                                   | MS BUR02-311                   |
> | e-mail: tony.printezis at    | 35 Network Drive               |
> | office: +1 781 442 0998 (x20998)  | Burlington, MA01803-0902, USA  |
> ----------------------------------------------------------------------
> e-mail client: Thunderbird (Solaris)

More information about the hotspot-gc-dev mailing list