< prev index next >

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

Print this page

        

@@ -24,17 +24,14 @@
 package MyPackage;
 
 /**
  * @test
  * @summary Verifies the JVMTI Heap Monitor Statistics
- * @build Frame
  * @compile HeapMonitorStatSimpleTest.java
  * @run main/othervm/native -agentlib:HeapMonitor MyPackage.HeapMonitorStatSimpleTest
  */
 
-import java.io.PrintStream;
-
 public class HeapMonitorStatSimpleTest {
 
   static {
     try {
       System.loadLibrary("HeapMonitor");

@@ -44,18 +41,16 @@
           + System.getProperty("java.library.path"));
       throw ule;
     }
   }
 
-  native static int statsNull();
-  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 statsNull();
+  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++) {
       int tmp[] = new int[1];
       // Force it to be kept.

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