--- old/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java 2017-10-06 14:50:58.638480321 -0700 +++ new/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java 2017-10-06 14:50:58.282481519 -0700 @@ -25,16 +25,12 @@ /** * @test - * @summary Verifies the JVMTI Heap Monitor Statistics - * @build Frame + * @summary Verifies the JVMTI Heap Monitor sampling rate average * @compile HeapMonitorStatRateTest.java * @run main/othervm/native -agentlib:HeapMonitor MyPackage.HeapMonitorStatRateTest */ -import java.io.PrintStream; - public class HeapMonitorStatRateTest { - static { try { System.loadLibrary("HeapMonitor"); @@ -46,15 +42,13 @@ } } - native static double getAverageRate(); - native static int enableSampling(int rate); - native static void disableSampling(); - - public static int cnt; - public static int g_tmp[]; - public int array[]; + private static int g_tmp[]; + + private native static double getAverageRate(); + private native static int enableSampling(int rate); + private native static void disableSampling(); - public static int helper() { + private static int helper() { int sum = 0; // Let us assume that the array is 24 bytes of memory. for (int i = 0; i < 127000 / 6; i++) { @@ -66,7 +60,7 @@ return sum; } - public static void wrapper() { + private static void wrapper() { int sum = 0; for (int j = 0; j < 5000; j++) { sum += helper();