1. G1 regions are sized in powers of 2, starting at 1 MB.
2. Heaps that have a very different maximum size than initial size will have too
many G1 regions; the G1 region size should be increased in that case.
3. Applications that allocate objects larger than half the size of a G1 region should
increase the G1 region size, so that the objects can fit within a G1 region. An ap-
plication must allocate an object that is at least 512 KB for this to apply (since the
smallest G1 region is 1 MB).
The AggressiveHeap flag (by default, false ), was introduced in an early version of Java as
an attempt to make it easier to easily set a variety of command-line arguments—arguments
that would be appropriate for a very large machine with a lot of memory running a single
JVM. It applies only to 64-bit JVMs.
Although the flag has been carried forward since those versions and is still present, it is no
longer recommended (though it is not yet officially deprecated). The problem with this flag
is that it hides the actual tunings it adopts, making it quite hard to figure out what the JVM is
actually setting. Some of the values it sets are now set ergonomically based on better inform-
ation about the machine running the JVM, so there are actually cases where enabling this
flag hurts performance. I have often seen command lines that include this flag and then later
override values that it sets. (For the record, that works: later values in the command line cur-
rently override earlier values. That behavior is not guaranteed.)
Table 6-4 lists all the tunings that are automatically set when the AggressiveHeap flag is en-