diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 3806b6177e54563f652ed9ab6a6805ed830092f3..ccfc007f3a95884c8fc7a9a765cab99e9ec53b51 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -81,7 +81,6 @@ runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all serviceability/sa/TestRevPtrsForInvokeDynamic.java 8191270 generic-all serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all -serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 8205541 generic-all serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java 8205652 generic-all ############################################################################# diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java index a651efb8546736b51594dac6309a5feb1a6ac949..33a3226981924d5f2b70abeb2f02edc3b8b4295c 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java @@ -46,8 +46,6 @@ public class HeapMonitorStatArrayCorrectnessTest { public static void main(String[] args) { int sizes[] = {1000, 10000, 100000}; - HeapMonitor.enableSamplingEvents(); - for (int currentSize : sizes) { System.out.println("Testing size " + currentSize); @@ -56,12 +54,16 @@ public class HeapMonitorStatArrayCorrectnessTest { throw new RuntimeException("Should not have any events stored yet."); } + HeapMonitor.enableSamplingEvents(); + // 111 is as good a number as any. final int samplingMultiplier = 111; HeapMonitor.setSamplingRate(samplingMultiplier * currentSize); allocate(currentSize); + HeapMonitor.disableSamplingEvents(); + // For simplifications, we ignore the array memory usage for array internals (with the array // sizes requested, it should be a negligible oversight). // diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java index 36fdecf05fba1978160af6f61dce16b927d45e8d..e51fe64dc7681380a7cb7ba418fcdee2fb4b2ee8 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java @@ -41,9 +41,13 @@ public class HeapMonitorStatObjectCorrectnessTest { private native static boolean statsHaveExpectedNumberSamples(int expected, int percentError); private static void allocate() { + emptyStorage(); + + HeapMonitor.enableSamplingEvents(); for (int j = 0; j < maxIteration; j++) { obj = new BigObject(); } + HeapMonitor.disableSamplingEvents(); } private static void testBigAllocationRate() { @@ -53,7 +57,6 @@ public class HeapMonitorStatObjectCorrectnessTest { final int samplingMultiplier = 111; HeapMonitor.setSamplingRate(samplingMultiplier * sizeObject); - emptyStorage(); allocate(); // For simplifications, the code is allocating: @@ -96,7 +99,6 @@ public class HeapMonitorStatObjectCorrectnessTest { // 0 means sample every allocation. HeapMonitor.setSamplingRate(0); - emptyStorage(); allocate(); double expected = maxIteration; @@ -111,8 +113,6 @@ public class HeapMonitorStatObjectCorrectnessTest { } public static void main(String[] args) { - HeapMonitor.enableSamplingEvents(); - testBigAllocationRate(); testEveryAllocationSampled(); } diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c index 0ff03ffed65c4578b871c2303ffae145a810d56e..41df828951ecb1229d79d42f896f7f685e95ae06 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c @@ -45,7 +45,7 @@ extern "C" { #define TRUE 1 #define FALSE 0 -#define PRINT_OUT 0 +#define PRINT_OUT 1 static jvmtiEnv *jvmti = NULL; static jvmtiEnv *second_jvmti = NULL;