32 * @key gc
33 * @bug 8199868
34 * @library /
35 * @requires (os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386") & vm.gc.Epsilon & !vm.graal.enabled
36 * @summary test argument pinning by nmethod wrapper of critical native method
37 * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx1G -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
38 */
39
40 /*
41 * @test CriticalNativeStressShenandoah
42 * @key gc
43 * @bug 8199868
44 * @library /
45 * @requires (os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386") & vm.gc.Shenandoah & !vm.graal.enabled
46 * @summary test argument pinning by nmethod wrapper of critical native method
47 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
48 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
49 *
50 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
51 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
52 */
53 public class CriticalNativeStress {
54 private static Random rand = new Random();
55
56 // CYCLES and THREAD_PER_CASE are used to tune the tests for different GC settings,
57 // so that they can execrise enough GC cycles and not OOM
58 private static int CYCLES = Integer.getInteger("cycles", 3);
59 private static int THREAD_PER_CASE = Integer.getInteger("threadPerCase", 1);
60
61 static long sum(long[] a) {
62 long sum = 0;
63 for (int index = 0; index < a.length; index ++) {
64 sum += a[index];
65 }
66 return sum;
67 }
68
69 static long sum(int[] a) {
70 long sum = 0;
71 for (int index = 0; index < a.length; index ++) {
|
32 * @key gc
33 * @bug 8199868
34 * @library /
35 * @requires (os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386") & vm.gc.Epsilon & !vm.graal.enabled
36 * @summary test argument pinning by nmethod wrapper of critical native method
37 * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx1G -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
38 */
39
40 /*
41 * @test CriticalNativeStressShenandoah
42 * @key gc
43 * @bug 8199868
44 * @library /
45 * @requires (os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386") & vm.gc.Shenandoah & !vm.graal.enabled
46 * @summary test argument pinning by nmethod wrapper of critical native method
47 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
48 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
49 *
50 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
51 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
52 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
53 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
54 */
55 public class CriticalNativeStress {
56 private static Random rand = new Random();
57
58 // CYCLES and THREAD_PER_CASE are used to tune the tests for different GC settings,
59 // so that they can execrise enough GC cycles and not OOM
60 private static int CYCLES = Integer.getInteger("cycles", 3);
61 private static int THREAD_PER_CASE = Integer.getInteger("threadPerCase", 1);
62
63 static long sum(long[] a) {
64 long sum = 0;
65 for (int index = 0; index < a.length; index ++) {
66 sum += a[index];
67 }
68 return sum;
69 }
70
71 static long sum(int[] a) {
72 long sum = 0;
73 for (int index = 0; index < a.length; index ++) {
|