Summary
-------
Extend the range of allowable values for `G1HeapRegionSize` to improve humongous object fragmentation issues.
Problem
-------
G1 is a regional collector: the Java heap is split into evenly sized regions. All allocation and evacuation occurs on a region basis. Humongous objects, i.e. objects larger than half a region, are handled differently: they need to be allocated in a contiguous set of those regions separately, and due to their size do not move ever.
This can cause waste within regions (at the end of the last region containing that humongous object) and problems with fragmentation on a region level: G1 might not find an appropriate set of contiguous regions to allocate a new humongous object.
Both problems can cause issues ranging from increased GC activity to out-of-memory conditions.
Solution
--------
Increase the available range of user-configurable region sizes from 32MB to 512MB on 64 bit platforms made possible by an earlier change (JDK-8017163). By allowing larger heap region sizes, a formerly humongous object may not be considered humongous any more, decreasing the fragmentation issues. Ergonomics will keep selecting only heap region sizes up to 32MB.
Specification
-------------
product(size_t, G1HeapRegionSize, 0, \
"Size of the G1 regions.") \
- range(0, 32*M) \
+ range(0, NOT_LP64(32*M) LP64_ONLY(512*M)) \
constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit) \
\
product(uint, G1ConcRefinementThreads, 0, \