25 /*
26 * @test TestRefprocSanity
27 * @summary Test that null references/referents work fine
28 * @key gc
29 * @requires vm.gc.Shenandoah & !vm.graal.enabled
30 *
31 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
32 * -XX:+UseShenandoahGC
33 * -XX:+ShenandoahVerify
34 * TestRefprocSanity
35 *
36 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
37 * -XX:+UseShenandoahGC
38 * TestRefprocSanity
39 *
40 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
41 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
42 * TestRefprocSanity
43 */
44
45 import java.lang.ref.*;
46
47 public class TestRefprocSanity {
48
49 static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
50 static final int WINDOW = 10_000;
51
52 static final Reference<MyObject>[] refs = new Reference[WINDOW];
53
54 public static void main(String[] args) throws Exception {
55 long count = TARGET_MB * 1024 * 1024 / 32;
56 int rIdx = 0;
57
58 ReferenceQueue rq = new ReferenceQueue();
59
60 for (int c = 0; c < WINDOW; c++) {
61 refs[c] = select(c, new MyObject(c), rq);
62 }
63
64 for (int c = 0; c < count; c++) {
|
25 /*
26 * @test TestRefprocSanity
27 * @summary Test that null references/referents work fine
28 * @key gc
29 * @requires vm.gc.Shenandoah & !vm.graal.enabled
30 *
31 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
32 * -XX:+UseShenandoahGC
33 * -XX:+ShenandoahVerify
34 * TestRefprocSanity
35 *
36 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
37 * -XX:+UseShenandoahGC
38 * TestRefprocSanity
39 *
40 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
41 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
42 * TestRefprocSanity
43 */
44
45 /*
46 * @test TestRefprocSanity
47 * @summary Test that null references/referents work fine
48 * @key gc
49 * @requires vm.gc.Shenandoah & !vm.graal.enabled
50 *
51 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
52 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
53 * -XX:+ShenandoahVerify
54 * TestRefprocSanity
55 *
56 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
57 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
58 * TestRefprocSanity
59 *
60 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
61 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
62 * TestRefprocSanity
63 */
64
65 import java.lang.ref.*;
66
67 public class TestRefprocSanity {
68
69 static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
70 static final int WINDOW = 10_000;
71
72 static final Reference<MyObject>[] refs = new Reference[WINDOW];
73
74 public static void main(String[] args) throws Exception {
75 long count = TARGET_MB * 1024 * 1024 / 32;
76 int rIdx = 0;
77
78 ReferenceQueue rq = new ReferenceQueue();
79
80 for (int c = 0; c < WINDOW; c++) {
81 refs[c] = select(c, new MyObject(c), rq);
82 }
83
84 for (int c = 0; c < count; c++) {
|