< prev index next >

test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java

Print this page
rev 49267 : [mq]: event5
rev 49268 : [mq]: event6
rev 49269 : [mq]: event7

@@ -49,10 +49,11 @@
     HeapMonitor.enableSamplingEvents();
 
     for (int currentSize : sizes) {
       System.out.println("Testing size " + currentSize);
 
+      HeapMonitor.resetEventStorage();
       if (!HeapMonitor.eventStorageIsEmpty()) {
         throw new RuntimeException("Should not have any events stored yet.");
       }
 
       // 111 is as good a number as any.

@@ -77,10 +78,8 @@
 
       // 10% error ensures a sanity test without becoming flaky.
       if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, 10)) {
         throw new RuntimeException("Statistics should show about " + expected + " samples.");
       }
-
-      HeapMonitor.resetEventStorage();
     }
   }
 }
< prev index next >