28
28
* @requires vm.gc.Shenandoah
29
29
* @library /test/lib
30
30
*
31
- * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
31
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
32
32
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
33
33
* -XX:+ShenandoahVerify -XX:+ShenandoahDegeneratedGC
34
34
* TestPinnedGarbage
35
35
*
36
- * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
36
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
37
37
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
38
38
* -XX:+ShenandoahVerify -XX:-ShenandoahDegeneratedGC
39
39
* TestPinnedGarbage
45
45
* @requires vm.gc.Shenandoah
46
46
* @library /test/lib
47
47
*
48
- * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
48
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
49
49
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
50
50
* TestPinnedGarbage
51
51
*
52
- * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
52
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
53
53
* -XX:+UseShenandoahGC
54
54
* -XX:+ShenandoahVerify
55
55
* TestPinnedGarbage
@@ -65,26 +65,26 @@ public class TestPinnedGarbage {
65
65
}
66
66
67
67
private static final int NUM_RUNS = 1_000 ;
68
- private static final int OBJS_COUNT = 1_000 ;
69
- private static final int GARBAGE_COUNT = 1_000_000 ;
68
+ private static final int OBJS_COUNT = 1 << 10 ;
69
+ private static final int GARBAGE_COUNT = 1 << 18 ;
70
70
71
71
private static native void pin (int [] a );
72
72
private static native void unpin (int [] a );
73
73
74
74
public static void main (String [] args ) {
75
+ Random rng = Utils .getRandomInstance ();
75
76
for (int i = 0 ; i < NUM_RUNS ; i ++) {
76
- test ();
77
+ test (rng );
77
78
}
78
79
}
79
80
80
- private static void test () {
81
+ private static void test (Random rng ) {
81
82
Object [] objs = new Object [OBJS_COUNT ];
82
83
for (int i = 0 ; i < OBJS_COUNT ; i ++) {
83
84
objs [i ] = new MyClass ();
84
85
}
85
86
86
87
int [] cog = new int [10 ];
87
- Random rng = Utils .getRandomInstance ();
88
88
int cogIdx = rng .nextInt (OBJS_COUNT );
89
89
objs [cogIdx ] = cog ;
90
90
pin (cog );
0 commit comments