27
27
* @summary Test that null references/referents work fine
28
28
* @requires vm.gc.Shenandoah
29
29
*
30
- * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
30
+ * @run main/othervm -Xmx128m -Xms128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
31
31
* -XX:+UseShenandoahGC
32
32
* -XX:+ShenandoahVerify
33
33
* TestRefprocSanity
34
34
*
35
- * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
35
+ * @run main/othervm -Xmx128m -Xms128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
36
36
* -XX:+UseShenandoahGC
37
37
* TestRefprocSanity
38
38
*
39
- * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
39
+ * @run main/othervm -Xmx128m -Xms128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
40
40
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
41
41
* TestRefprocSanity
42
42
*/
46
46
* @summary Test that null references/referents work fine
47
47
* @requires vm.gc.Shenandoah
48
48
*
49
- * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
49
+ * @run main/othervm -Xmx128m -Xms128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
50
50
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
51
51
* -XX:+ShenandoahVerify
52
52
* TestRefprocSanity
53
53
*
54
- * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
54
+ * @run main/othervm -Xmx128m -Xms128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
55
55
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
56
56
* TestRefprocSanity
57
57
*
58
- * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
58
+ * @run main/othervm -Xmx128m -Xms128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
59
59
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
60
60
* TestRefprocSanity
61
61
*/
64
64
65
65
public class TestRefprocSanity {
66
66
67
- static final long TARGET_MB = Long .getLong ("target" , 10_000 ); // 10 Gb allocation
68
- static final int WINDOW = 10_000 ;
67
+ static final long TARGET_MB = Long .getLong ("target" , 1_000 ); // 1 Gb allocation
68
+ static final int WINDOW = 1_000 ;
69
69
70
70
static final Reference <MyObject >[] refs = new Reference [WINDOW ];
71
71
72
+ static Object sink ;
73
+
72
74
public static void main (String [] args ) throws Exception {
73
- long count = TARGET_MB * 1024 * 1024 / 32 ;
75
+ long count = TARGET_MB * 1024 * 1024 / 128 ;
74
76
int rIdx = 0 ;
75
77
76
78
ReferenceQueue rq = new ReferenceQueue ();
@@ -87,7 +89,12 @@ public static void main(String[] args) throws Exception {
87
89
if (rIdx >= WINDOW ) {
88
90
rIdx = 0 ;
89
91
}
90
- while (rq .poll () != null ); // drain
92
+
93
+ // Do allocations to force GCs
94
+ sink = new byte [100 ];
95
+
96
+ // Drain the refqueue
97
+ while (rq .poll () != null );
91
98
}
92
99
}
93
100
0 commit comments