RFR(M) 8186834:Expanding old area without full GC in parallel GC
Thomas Schatzl
thomas.schatzl at oracle.com
Fri Oct 13 13:04:21 UTC 2017
Hi,
On Tue, 2017-08-29 at 00:20 +0900, Michihiro Horie wrote:
> Dear all,
>
> Would you please review the following change?
> bug: https://bugs.openjdk.java.net/browse/JDK-8186834
> webrev: http://cr.openjdk.java.net/~mhorie/8186834/webrev.00/
>
> In parallel GC, old area is expanded only after a full GC occurs.
> I am wondering if we could give an option to expand old area without
> full GC. So, I added an option
> UseAdaptiveGenerationSizePolicyBeforeMajorCollection
Sorry for the late (and probably stupid) question, but what is the
difference (in performance) to simply set -Xms==-Xmx here?
And why not make the (first) full gc expand the heap more aggressively?
(I think there is at least one way to do that, something like
Min/MaxFreeHeapRatio or so, I can look it up if needed).
Thanks,
Thomas
> Following is a simple micro benchmark I used to see the benefit of
> this change.
> As a result, pause time of full GC reduced by 30%. Full GC count
> reduced by 54%.
> Elapsed time reduced by 7%.
>
> import java.util.HashMap;
> import java.util.Map;
> public class HeapExpandTest {
> static Map<Integer, byte[]> map = new HashMap<>();
> public static void main(String[] args) throws Exception {
> long start = System.currentTimeMillis();
> for (int i = 0; i < 2200; ++i) {
> map.put(i, new byte[1024*1024]); // 1MB
> }
> System.out.println("elapsed= " + (System.currentTimeMillis() -
> start));
> }
> }
>
> JVM options: -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy
> -XX:ParallelGCThreads=8 -Xms64m -Xmx3g
> -XX:+UseAdaptiveGenerationSizePolicyBeforeMajorCollection
More information about the hotspot-dev
mailing list