--- old/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorOnOffTest.java 2017-10-06 14:50:54.770493335 -0700 +++ new/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorOnOffTest.java 2017-10-06 14:50:54.378494654 -0700 @@ -31,10 +31,7 @@ * @run main/othervm/native -agentlib:HeapMonitor MyPackage.HeapMonitorOnOffTest */ -import java.io.PrintStream; - public class HeapMonitorOnOffTest { - static { try { System.loadLibrary("HeapMonitor"); @@ -46,7 +43,9 @@ } } - public static int helper() { + private static int g_tmp[]; + + 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++) { @@ -58,7 +57,7 @@ return sum; } - public static void wrapper() { + private static void wrapper() { int sum = 0; for (int j = 0; j < 1000; j++) { sum += helper(); @@ -66,20 +65,16 @@ System.out.println(sum); } - native static int checkFrames(Frame[] frames); - native static int checkWipeOut(Frame[] frames); - native static int enableSampling(); - native static int disableSampling(); - - public static int cnt; - public static int g_tmp[]; - public int array[]; + private native static int checkFrames(Frame[] frames); + private native static int checkWipeOut(Frame[] frames); + private native static int enableSampling(); + private native static int disableSampling(); public static void main(String[] args) { Frame[] frames = new Frame[3]; - frames[0] = new Frame("helper", "()I", "HeapMonitorOnOffTest.java", 53); - frames[1] = new Frame("wrapper", "()V", "HeapMonitorOnOffTest.java", 64); - frames[2] = new Frame("main", "([Ljava/lang/String;)V", "HeapMonitorOnOffTest.java", 86); + frames[0] = new Frame("helper", "()I", "HeapMonitorOnOffTest.java", 52); + frames[1] = new Frame("wrapper", "()V", "HeapMonitorOnOffTest.java", 63); + frames[2] = new Frame("main", "([Ljava/lang/String;)V", "HeapMonitorOnOffTest.java", 81); // Enable sampling and allocate. enableSampling();