41 import jdk.test.lib.ProcessTools; |
41 import jdk.test.lib.ProcessTools; |
42 |
42 |
43 public class TestVerifyBeforeAndAfterGCFlags { |
43 public class TestVerifyBeforeAndAfterGCFlags { |
44 |
44 |
45 // VerifyBeforeGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] |
45 // VerifyBeforeGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] |
46 public static final String VERIFY_BEFORE_GC_PATTERN = "VerifyBeforeGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; |
46 public static final String VERIFY_BEFORE_GC_PATTERN = "Verifying Before GC"; |
47 // VerifyBeforeGC: VerifyBeforeGC: VerifyBeforeGC: |
47 // VerifyBeforeGC: VerifyBeforeGC: VerifyBeforeGC: |
48 public static final String VERIFY_BEFORE_GC_CORRUPTED_PATTERN = "VerifyBeforeGC:(?!\\[Verifying[^]]+\\])"; |
48 public static final String VERIFY_BEFORE_GC_CORRUPTED_PATTERN = "VerifyBeforeGC:(?!\\[Verifying[^]]+\\])"; |
49 |
49 |
50 // VerifyAfterGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] |
50 // VerifyAfterGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] |
51 public static final String VERIFY_AFTER_GC_PATTERN = "VerifyAfterGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; |
51 public static final String VERIFY_AFTER_GC_PATTERN = "Verifying After GC"; |
52 // VerifyAfterGC: VerifyAfterGC: VerifyAfterGC: |
52 // VerifyAfterGC: VerifyAfterGC: VerifyAfterGC: |
53 public static final String VERIFY_AFTER_GC_CORRUPTED_PATTERN = "VerifyAfterGC:(?!\\[Verifying[^]]+\\])"; |
53 public static final String VERIFY_AFTER_GC_CORRUPTED_PATTERN = "VerifyAfterGC:(?!\\[Verifying[^]]+\\])"; |
54 |
54 |
55 public static void main(String args[]) throws Exception { |
55 public static void main(String args[]) throws Exception { |
56 String[] filteredOpts = Utils.getFilteredTestJavaOpts( |
56 String[] filteredOpts = Utils.getFilteredTestJavaOpts( |
57 new String[] { "-Xloggc:", |
57 new String[] { "-Xlog:gc+verify=debug", |
58 "-XX:+UseGCLogFileRotation", |
58 "-XX:+UseGCLogFileRotation", |
59 "-XX:-DisplayVMOutput", |
59 "-XX:-DisplayVMOutput", |
60 "VerifyBeforeGC", |
60 "VerifyBeforeGC", |
61 "VerifyAfterGC" }); |
61 "VerifyAfterGC" }); |
62 testVerifyFlags(false, false, filteredOpts); |
62 testVerifyFlags(false, false, filteredOpts); |
72 if (opts != null && (opts.length > 0)) { |
72 if (opts != null && (opts.length > 0)) { |
73 Collections.addAll(vmOpts, opts); |
73 Collections.addAll(vmOpts, opts); |
74 } |
74 } |
75 |
75 |
76 Collections.addAll(vmOpts, new String[] { |
76 Collections.addAll(vmOpts, new String[] { |
|
77 "-Xlog:gc+verify=debug", |
77 "-Xmx5m", |
78 "-Xmx5m", |
78 "-Xms5m", |
79 "-Xms5m", |
79 "-Xmn3m", |
80 "-Xmn3m", |
80 "-XX:+UnlockDiagnosticVMOptions", |
81 "-XX:+UnlockDiagnosticVMOptions", |
81 (verifyBeforeGC ? "-XX:+VerifyBeforeGC" |
82 (verifyBeforeGC ? "-XX:+VerifyBeforeGC" |