# HG changeset patch # User rehn # Date 1465976622 -7200 # Node ID 2ab36381092540e20e759a032c0e3f88eca2e435 # Parent d504ca981ccfbe2ab13afc1ab67f81bb0cb92cf8 8149778: serviceability/tmtools/jstat/GcCapacityTest.java causes JVM to hang during GC Reviewed-by: pliden, stefank diff -r d504ca981ccf -r 2ab363810925 hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java --- a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java Tue Jun 14 19:30:19 2016 +0000 +++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java Wed Jun 15 09:43:42 2016 +0200 @@ -33,7 +33,6 @@ * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @build common.* * @build utils.* - * @ignore 8149778 * @run main/othervm -XX:+UsePerfData -Xmx128M GcCapacityTest */ public class GcCapacityTest { diff -r d504ca981ccf -r 2ab363810925 hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java --- a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java Tue Jun 14 19:30:19 2016 +0000 +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java Wed Jun 15 09:43:42 2016 +0200 @@ -42,8 +42,9 @@ // uses fixed small objects to avoid Humongous objects allocation in G1 int memoryChunk = 2048; List list = new ArrayList<>(); - float used = 0; - while (used < targetUsage * maxMemory) { + long used = 0; + long target = (long) (maxMemory * targetUsage); + while (used < target) { try { list.add(new byte[memoryChunk]); used += memoryChunk;