75 * TestRetainObjects
76 *
77 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
78 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
79 * TestRetainObjects
80 *
81 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
82 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
83 * TestRetainObjects
84 *
85 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
86 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
87 * TestRetainObjects
88 *
89 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
90 * -XX:+UseShenandoahGC
91 * -XX:-UseTLAB -XX:+ShenandoahVerify
92 * TestRetainObjects
93 */
94
95 public class TestRetainObjects {
96
97 static final int COUNT = 10_000_000;
98 static final int WINDOW = 10_000;
99
100 static final String[] reachable = new String[WINDOW];
101
102 public static void main(String[] args) throws Exception {
103 int rIdx = 0;
104 for (int c = 0; c < COUNT; c++) {
105 reachable[rIdx] = ("LargeString" + c);
106 rIdx++;
107 if (rIdx >= WINDOW) {
108 rIdx = 0;
109 }
110 }
111 }
112
113 }
|
75 * TestRetainObjects
76 *
77 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
78 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
79 * TestRetainObjects
80 *
81 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
82 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
83 * TestRetainObjects
84 *
85 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
86 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
87 * TestRetainObjects
88 *
89 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
90 * -XX:+UseShenandoahGC
91 * -XX:-UseTLAB -XX:+ShenandoahVerify
92 * TestRetainObjects
93 */
94
95 /*
96 * @test TestRetainObjects
97 * @summary Acceptance tests: collector can deal with retained objects
98 * @key gc
99 * @requires vm.gc.Shenandoah & !vm.graal.enabled
100 *
101 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
102 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
103 * -XX:+ShenandoahOOMDuringEvacALot
104 * TestRetainObjects
105 *
106 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
107 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
108 * -XX:+ShenandoahAllocFailureALot
109 * TestRetainObjects
110 *
111 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
112 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
113 * TestRetainObjects
114 *
115 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
116 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
117 * -XX:+ShenandoahVerify
118 * TestRetainObjects
119 *
120 * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
121 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
122 * TestRetainObjects
123 */
124
125 public class TestRetainObjects {
126
127 static final int COUNT = 10_000_000;
128 static final int WINDOW = 10_000;
129
130 static final String[] reachable = new String[WINDOW];
131
132 public static void main(String[] args) throws Exception {
133 int rIdx = 0;
134 for (int c = 0; c < COUNT; c++) {
135 reachable[rIdx] = ("LargeString" + c);
136 rIdx++;
137 if (rIdx >= WINDOW) {
138 rIdx = 0;
139 }
140 }
141 }
142
143 }
|