author | vtewari |
Tue, 13 Sep 2016 17:00:06 +0530 | |
changeset 40937 | f72e61ec734b |
parent 40631 | ed82623d7831 |
child 44522 | b10606c613ef |
permissions | -rw-r--r-- |
34623
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
1 |
/* |
36173
31a3af05892d
8146728: TestPrintGCDetailsVerbose is never run by jtreg
kbarrett
parents:
34623
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
34623
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
4 |
* |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
8 |
* |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
13 |
* accompanied this code). |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
14 |
* |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
18 |
* |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
21 |
* questions. |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
22 |
*/ |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
23 |
|
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
24 |
/* |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
25 |
* @test TestPrintGCDetailsVerbose |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
26 |
* @bug 8016740 |
36173
31a3af05892d
8146728: TestPrintGCDetailsVerbose is never run by jtreg
kbarrett
parents:
34623
diff
changeset
|
27 |
* @summary Tests that jvm with maximally verbose GC logging does not crash when ParOldGC has no memory |
34623
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
28 |
* @key gc |
39414
4adf52148100
8160088: update hotspot tests depending on GC to use @requires vm.gc.X
dfazunen
parents:
38152
diff
changeset
|
29 |
* @requires vm.gc.Parallel |
38152
80e5da81fb2c
8154258: [TESTBUG] Various serviceability tests fail compilation
dsamersoff
parents:
36173
diff
changeset
|
30 |
* @modules java.base/jdk.internal.misc |
36173
31a3af05892d
8146728: TestPrintGCDetailsVerbose is never run by jtreg
kbarrett
parents:
34623
diff
changeset
|
31 |
* @run main/othervm -Xmx50m -XX:+UseParallelGC -Xlog:gc*=trace TestPrintGCDetailsVerbose |
34623
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
32 |
*/ |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
33 |
public class TestPrintGCDetailsVerbose { |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
34 |
|
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
35 |
public static void main(String[] args) { |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
36 |
for (int t = 0; t <= 10; t++) { |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
37 |
byte a[][] = new byte[100000][]; |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
38 |
try { |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
39 |
for (int i = 0; i < a.length; i++) { |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
40 |
a[i] = new byte[100000]; |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
41 |
} |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
42 |
} catch (OutOfMemoryError oome) { |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
43 |
a = null; |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
44 |
System.out.println("OOM!"); |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
45 |
continue; |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
46 |
} |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
47 |
} |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
48 |
} |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
49 |
} |
3aff37e35ebe
8016752: [Newtest] regression test for PrintGCDetails and Verbose flags do not crash when ParOldGC has no memory
dfazunen
parents:
diff
changeset
|
50 |