changeset 39285:2ab363810925

8149778: serviceability/tmtools/jstat/GcCapacityTest.java causes JVM to hang during GC Reviewed-by: pliden, stefank
author rehn
date Wed, 15 Jun 2016 09:43:42 +0200
parents d504ca981ccf
children 0613bf956db4
files hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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 {
--- 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<Object> 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;