< prev index next >
test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatSimpleTest.java
Print this page
*** 24,40 ****
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");
--- 24,37 ----
*** 44,61 ****
+ System.getProperty("java.library.path"));
throw ule;
}
}
! native static int statsNull();
! native static int enableSampling();
! public static int cnt;
! public static int g_tmp[];
! public int array[];
! public 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.
--- 41,56 ----
+ System.getProperty("java.library.path"));
throw ule;
}
}
! private static int g_tmp[];
! private native static int statsNull();
! private native static int enableSampling();
! 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,73 ****
sum += g_tmp[0];
}
return sum;
}
! public static void wrapper() {
int sum = 0;
for (int j = 0; j < 1000; j++) {
sum += helper();
}
System.out.println(sum);
--- 58,68 ----
sum += g_tmp[0];
}
return sum;
}
! private static void wrapper() {
int sum = 0;
for (int j = 0; j < 1000; j++) {
sum += helper();
}
System.out.println(sum);
< prev index next >