Skip to content

Commit 659db06

Browse files
author
duke
committed
Automatic merge of jdk:master into master
2 parents ebea69a + 86f3602 commit 659db06

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/hotspot/jtreg/gc/shenandoah/jni/TestPinnedGarbage.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
* @requires vm.gc.Shenandoah
2929
* @library /test/lib
3030
*
31-
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
31+
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
3232
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
3333
* -XX:+ShenandoahVerify -XX:+ShenandoahDegeneratedGC
3434
* TestPinnedGarbage
3535
*
36-
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
36+
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
3737
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
3838
* -XX:+ShenandoahVerify -XX:-ShenandoahDegeneratedGC
3939
* TestPinnedGarbage
@@ -45,11 +45,11 @@
4545
* @requires vm.gc.Shenandoah
4646
* @library /test/lib
4747
*
48-
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
48+
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
4949
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
5050
* TestPinnedGarbage
5151
*
52-
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx512m
52+
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx128m
5353
* -XX:+UseShenandoahGC
5454
* -XX:+ShenandoahVerify
5555
* TestPinnedGarbage
@@ -65,26 +65,26 @@ public class TestPinnedGarbage {
6565
}
6666

6767
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;
7070

7171
private static native void pin(int[] a);
7272
private static native void unpin(int[] a);
7373

7474
public static void main(String[] args) {
75+
Random rng = Utils.getRandomInstance();
7576
for (int i = 0; i < NUM_RUNS; i++) {
76-
test();
77+
test(rng);
7778
}
7879
}
7980

80-
private static void test() {
81+
private static void test(Random rng) {
8182
Object[] objs = new Object[OBJS_COUNT];
8283
for (int i = 0; i < OBJS_COUNT; i++) {
8384
objs[i] = new MyClass();
8485
}
8586

8687
int[] cog = new int[10];
87-
Random rng = Utils.getRandomInstance();
8888
int cogIdx = rng.nextInt(OBJS_COUNT);
8989
objs[cogIdx] = cog;
9090
pin(cog);

0 commit comments

Comments
 (0)