author | dcubed |
Thu, 14 Apr 2016 17:42:29 -0700 | |
changeset 37477 | 0ca0b7388bb6 |
parent 36851 | 03e2f4d0a421 |
parent 37428 | 6e724f3d488b |
child 40631 | ed82623d7831 |
permissions | -rw-r--r-- |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
1 |
/* |
37428
6e724f3d488b
8152896: Convert PrintCompressedOopsMode to Unified Logging
rprotacio
parents:
33785
diff
changeset
|
2 |
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
4 |
* |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
8 |
* |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
13 |
* accompanied this code). |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
14 |
* |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
18 |
* |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
21 |
* questions. |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
22 |
*/ |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
23 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
24 |
/* |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
25 |
* @test |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
26 |
* @bug 8022865 |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
27 |
* @summary Tests for different combination of UseCompressedOops options |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
28 |
* @library /testlibrary |
33785
f5e6ef11d24b
8141533: [TESTBUG] Add @ignore to runtime/CompressedOops/UseCompressedOops.java until JDK-8079353 has been resolved
ctornqvi
parents:
30604
diff
changeset
|
29 |
* @ignore 8079353 |
36851 | 30 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28372
diff
changeset
|
31 |
* java.management |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
32 |
* @run main UseCompressedOops |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
33 |
*/ |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
34 |
import java.util.ArrayList; |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
35 |
import java.util.Collections; |
30604
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
36 |
import jdk.test.lib.*; |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
37 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
38 |
public class UseCompressedOops { |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
39 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
40 |
public static void main(String[] args) throws Exception { |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
41 |
testCompressedOopsModesGCs(); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
42 |
testCompressedOopsModesGCs("-XX:+UseLargePages"); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
43 |
} |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
44 |
|
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
45 |
public static void testCompressedOopsModesGCs(String... flags) throws Exception { |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
46 |
ArrayList<String> args = new ArrayList<>(); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
47 |
Collections.addAll(args, flags); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
48 |
|
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
49 |
// Test default. |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
50 |
testCompressedOopsModes(args); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
51 |
// Test GCs. |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
52 |
testCompressedOopsModes(args, "-XX:+UseG1GC"); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
53 |
testCompressedOopsModes(args, "-XX:+UseConcMarkSweepGC"); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
54 |
testCompressedOopsModes(args, "-XX:+UseSerialGC"); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
55 |
testCompressedOopsModes(args, "-XX:+UseParallelGC"); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
56 |
testCompressedOopsModes(args, "-XX:+UseParallelOldGC"); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
57 |
} |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
58 |
|
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
59 |
public static void testCompressedOopsModes(ArrayList<String> flags1, String... flags2) throws Exception { |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
60 |
ArrayList<String> args = new ArrayList<>(); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
61 |
args.addAll(flags1); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
62 |
Collections.addAll(args, flags2); |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
63 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
64 |
if (Platform.is64bit()) { |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
65 |
// Explicitly turn of compressed oops |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
66 |
testCompressedOops(args, "-XX:-UseCompressedOops", "-Xmx32m") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
67 |
.shouldNotContain("Compressed Oops") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
68 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
69 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
70 |
// Compressed oops should be on by default |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
71 |
testCompressedOops(args, "-Xmx32m") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
72 |
.shouldContain("Compressed Oops mode") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
73 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
74 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
75 |
// Explicly enabling compressed oops |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
76 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
77 |
.shouldContain("Compressed Oops mode") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
78 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
79 |
|
26813
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
80 |
// Skip the following three test cases if we're on OSX or Solaris. |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
81 |
// |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
82 |
// OSX doesn't seem to care about HeapBaseMinAddress and Solaris |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
83 |
// puts the heap way up, forcing different behaviour. |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
84 |
if (!Platform.isOSX() && !Platform.isSolaris()) { |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
85 |
// Larger than 4gb heap should result in zero based with shift 3 |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
86 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx5g") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
87 |
.shouldContain("Zero based") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
88 |
.shouldContain("Oop shift amount: 3") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
89 |
.shouldHaveExitValue(0); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
90 |
|
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
91 |
// Larger than 3gb heap and HeapBaseMinAddress=1g should result in zero based with shift 3 |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
92 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx3200m", "-XX:HeapBaseMinAddress=1g") |
26813
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
93 |
.shouldContain("Zero based") |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
94 |
.shouldContain("Oop shift amount: 3") |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
95 |
.shouldHaveExitValue(0); |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
96 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
97 |
// Small heap above 4gb should result in zero based with shift 3 |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
98 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m", "-XX:HeapBaseMinAddress=4g") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
99 |
.shouldContain("Zero based") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
100 |
.shouldContain("Oop shift amount: 3") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
101 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
102 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
103 |
// Small heap above 32gb should result in non-zero based with shift 3 |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
104 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m", "-XX:HeapBaseMinAddress=32g") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
105 |
.shouldContain("Non-zero disjoint base") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
106 |
.shouldContain("Oop shift amount: 3") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
107 |
.shouldHaveExitValue(0); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
108 |
|
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
109 |
// Small heap above 32gb should result in non-zero based with shift 3 |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
110 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m", "-XX:HeapBaseMinAddress=72704m") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
111 |
.shouldContain("Non-zero based") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
112 |
.shouldContain("Oop shift amount: 3") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
113 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
114 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
115 |
// 32gb heap with heap base above 64gb and object alignment set to 16 bytes should result |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
116 |
// in non-zero based with shift 4 |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
117 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32g", "-XX:ObjectAlignmentInBytes=16", |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
118 |
"-XX:HeapBaseMinAddress=64g") |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
119 |
.shouldContain("Non-zero disjoint base") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
120 |
.shouldContain("Oop shift amount: 4") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
121 |
.shouldHaveExitValue(0); |
26813
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
122 |
|
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
123 |
// 32gb heap with object alignment set to 16 bytes should result in zero based with shift 4 |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
124 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32g", "-XX:ObjectAlignmentInBytes=16") |
26813
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
125 |
.shouldContain("Zero based") |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
126 |
.shouldContain("Oop shift amount: 4") |
fd74c05c4a7e
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents:
26688
diff
changeset
|
127 |
.shouldHaveExitValue(0); |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
128 |
} |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
129 |
|
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
130 |
// This is a pathologic case for the heap allocation algorithm. Regression test. |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
131 |
// HeapBaseMinAddress must be 2g and should not be set on the command line. |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
132 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx2g") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
133 |
.shouldNotContain("Max heap size too large for Compressed Oops") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
134 |
.shouldHaveExitValue(0); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
135 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx29g", "-XX:CompressedClassSpaceSize=1g") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
136 |
.shouldNotContain("Max heap size too large for Compressed Oops") |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
137 |
.shouldHaveExitValue(0); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
138 |
|
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
139 |
// Explicitly enabling compressed oops with 32gb heap should result a warning |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
140 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32g") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
141 |
.shouldContain("Max heap size too large for Compressed Oops") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
142 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
143 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
144 |
// 32gb heap should not result a warning |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
145 |
testCompressedOops(args, "-Xmx32g") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
146 |
.shouldNotContain("Max heap size too large for Compressed Oops") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
147 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
148 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
149 |
// Explicitly enabling compressed oops with 32gb heap and object |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
150 |
// alignment set to 8 byte should result a warning |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
151 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32g", "-XX:ObjectAlignmentInBytes=8") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
152 |
.shouldContain("Max heap size too large for Compressed Oops") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
153 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
154 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
155 |
// 64gb heap and object alignment set to 16 bytes should result in a warning |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
156 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx64g", "-XX:ObjectAlignmentInBytes=16") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
157 |
.shouldContain("Max heap size too large for Compressed Oops") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
158 |
.shouldHaveExitValue(0); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
159 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
160 |
} else { |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
161 |
// Compressed oops should only apply to 64bit platforms |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
162 |
testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m") |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
163 |
.shouldContain("Unrecognized VM option 'UseCompressedOops'") |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
164 |
.shouldHaveExitValue(1); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
165 |
} |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
166 |
} |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
167 |
|
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
168 |
private static OutputAnalyzer testCompressedOops(ArrayList<String> flags1, String... flags2) throws Exception { |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
169 |
ArrayList<String> args = new ArrayList<>(); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
170 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
171 |
// Always run with these three: |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
172 |
args.add("-XX:+PrintCompressedOopsMode"); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
173 |
args.add("-Xms32m"); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
174 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
175 |
// Add the extra flags |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
176 |
args.addAll(flags1); |
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
26813
diff
changeset
|
177 |
Collections.addAll(args, flags2); |
26688
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
178 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
179 |
args.add("-version"); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
180 |
|
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
181 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[0])); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
182 |
return new OutputAnalyzer(pb.start()); |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
183 |
} |
bb0cdd873e51
8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff
changeset
|
184 |
} |