< prev index next >

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

Print this page

        

@@ -29,12 +29,10 @@
  * @build Frame
  * @compile HeapMonitorFrequentTest.java
  * @run main/othervm/native -agentlib:HeapMonitor MyPackage.HeapMonitorFrequentTest
  */
 
-import java.io.PrintStream;
-
 public class HeapMonitorFrequentTest {
 
   static {
     try {
       System.loadLibrary("HeapMonitor");

@@ -44,18 +42,16 @@
           + System.getProperty("java.library.path"));
       throw ule;
     }
   }
 
-  native static int checkFrequentFrames(Frame[] frames);
-  native static int enableSampling();
+  private native static int checkFrequentFrames(Frame[] frames);
+  private native static int enableSampling();
 
-  public static int cnt;
-  public static int g_tmp[];
-  public int array[];
+  private static int g_tmp[];
 
-  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++) {
       int tmp[] = new int[1];
       // Force it to be kept.

@@ -63,11 +59,11 @@
       sum += g_tmp[0];
     }
     return sum;
   }
 
-  public static void runner(int max) {
+  private static void runner(int max) {
     int sum = 0;
     for (int j = 0; j < max; j++) {
       sum += helper();
     }
     System.out.println(sum);
< prev index next >