41 public static void testWith(String... args) throws Exception {
42 String[] cmds = Arrays.copyOf(args, args.length + 2);
43 cmds[args.length] = TestObjItrWithHeapDump.class.getName();
44 cmds[args.length + 1] = "test";
45 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds);
46
47 OutputAnalyzer output = new OutputAnalyzer(pb.start());
48 output.shouldHaveExitValue(0);
49 output.shouldContain("Class Histogram (before full gc)");
50 output.shouldContain("Class Histogram (after full gc)");
51 }
52
53 public static void main(String[] args) throws Exception {
54 if (args.length > 0 && args[0].equals("test")) {
55 System.gc();
56 System.exit(0);
57 }
58
59 String[][][] modeHeuristics = new String[][][] {
60 {{"normal"}, {"adaptive", "compact", "static", "aggressive"}},
61 {{"passive"}, {"passive"}}
62 };
63
64 for (String[][] mh : modeHeuristics) {
65 String mode = mh[0][0];
66 String[] heuristics = mh[1];
67 for (String h : heuristics) {
68 testWith("-XX:+UnlockDiagnosticVMOptions",
69 "-XX:+UnlockExperimentalVMOptions",
70 "-XX:+UseShenandoahGC",
71 "-XX:-ShenandoahDegeneratedGC",
72 "-XX:ShenandoahGCMode=" + mode,
73 "-XX:ShenandoahGCHeuristics=" + h,
74 "-Xlog:gc+classhisto=trace",
75 "-XX:-ExplicitGCInvokesConcurrent",
76 "-Xmx512M"
77 );
78 }
79 }
80 }
|
41 public static void testWith(String... args) throws Exception {
42 String[] cmds = Arrays.copyOf(args, args.length + 2);
43 cmds[args.length] = TestObjItrWithHeapDump.class.getName();
44 cmds[args.length + 1] = "test";
45 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds);
46
47 OutputAnalyzer output = new OutputAnalyzer(pb.start());
48 output.shouldHaveExitValue(0);
49 output.shouldContain("Class Histogram (before full gc)");
50 output.shouldContain("Class Histogram (after full gc)");
51 }
52
53 public static void main(String[] args) throws Exception {
54 if (args.length > 0 && args[0].equals("test")) {
55 System.gc();
56 System.exit(0);
57 }
58
59 String[][][] modeHeuristics = new String[][][] {
60 {{"normal"}, {"adaptive", "compact", "static", "aggressive"}},
61 {{"iu"}, {"adaptive", "aggressive"}},
62 {{"passive"}, {"passive"}}
63 };
64
65 for (String[][] mh : modeHeuristics) {
66 String mode = mh[0][0];
67 String[] heuristics = mh[1];
68 for (String h : heuristics) {
69 testWith("-XX:+UnlockDiagnosticVMOptions",
70 "-XX:+UnlockExperimentalVMOptions",
71 "-XX:+UseShenandoahGC",
72 "-XX:-ShenandoahDegeneratedGC",
73 "-XX:ShenandoahGCMode=" + mode,
74 "-XX:ShenandoahGCHeuristics=" + h,
75 "-Xlog:gc+classhisto=trace",
76 "-XX:-ExplicitGCInvokesConcurrent",
77 "-Xmx512M"
78 );
79 }
80 }
81 }
|