help with Adaptive Sizing Policy

Jon Masamitsu Jon.Masamitsu at Sun.COM
Wed Jan 28 19:57:38 UTC 2009

On 01/28/09 10:02, Shane Cox wrote:
> ...
> These are my questions:
> 1)  Since -Xmx and -Xms are both set to 1024m, shouldn't adaptive
> sizing be turned OFF?  Based on the GC log, it appears that the VM is
> resizing the YoungSpace between collections.

The overall size of the young gen should not be changing but
the adaptive size policy still will be changing the sizes
of the spaces (eden and the two survivor spaces).  The size of
young gen is considered to be the size of eden and 1 survivor
space (from-space).  The roles of the survivor spaces change
after a minor collection (from-space and to-space flip roles).
So if the survivor spaces are of different sizes (not uncommon),
then eden + from-space (where from-space is flipping between the
two survivor spaces) can be changing.

> 2)  Somewhere around line 35 of this file, the YoungSpace allocation
> decreases from approx 300MB to 171MB.  This occurs at a time when the
> VM appears to be extremely low on space.  Why would the allocation of
> YoungSpace, and therefore the VM's total Heap, decrease at a time when
> almost all available space is occupied?  In fact, it appears that the
> VM is on the verge of an OutOfMemoryException, yet the Heap allocation
> (Young + Old) is only 871936K, whereas the max allowable should be
> 1GB.  Clearly there is a dynamic at play that I'm not aware of.

There have just been a bunch of full collections so the adaptive size
policy is trying to move more of the work into the young gen
collections.  It does that by increasing the size of the survivor
spaces.  The survivor space are likely close to their maximum size
(1/3 of the total young gen).  The 871936K will not include 1 survivor

> 3)  Last, why would PermSpace allocation and occupancy grow over time?
>  I know very little about the classloader, and therefore have no idea
> when the decision is made to load a class ... though I presume most
> are loaded on startup for the server VM.

The perm gen actually looks pretty stable at around 59m.

Applications can load new classes as they need them.  This would
be something to as the customer - does their application use
new classes as it runs.

More information about the hotspot-gc-dev mailing list