--- old/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorTest.java 2017-10-06 14:51:01.150471868 -0700 +++ new/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorTest.java 2017-10-06 14:51:00.794473066 -0700 @@ -31,8 +31,6 @@ * @run main/othervm/native -agentlib:HeapMonitor MyPackage.HeapMonitorTest */ -import java.io.PrintStream; - public class HeapMonitorTest { static { @@ -46,14 +44,12 @@ } } - native static int checkFrames(Frame[] frames); - native static int enableSampling(); + private static int g_tmp[]; - public static int cnt; - public static int g_tmp[]; - public int array[]; + private native static int checkFrames(Frame[] frames); + private native static int enableSampling(); - 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++) { @@ -65,7 +61,7 @@ return sum; } - public static void wrapper() { + private static void wrapper() { int sum = 0; for (int j = 0; j < 1000; j++) { sum += helper(); @@ -75,9 +71,9 @@ public static void main(String[] args) { Frame[] frames = new Frame[3]; - frames[0] = new Frame("helper", "()I", "HeapMonitorTest.java", 60); - frames[1] = new Frame("wrapper", "()V", "HeapMonitorTest.java", 71); - frames[2] = new Frame("main", "([Ljava/lang/String;)V", "HeapMonitorTest.java", 83); + frames[0] = new Frame("helper", "()I", "HeapMonitorTest.java", 56); + frames[1] = new Frame("wrapper", "()V", "HeapMonitorTest.java", 67); + frames[2] = new Frame("main", "([Ljava/lang/String;)V", "HeapMonitorTest.java", 79); enableSampling(); wrapper();