author | tschatzl |
Wed, 25 Jun 2014 17:22:58 +0200 | |
changeset 25362 | 282191cd1bcc |
parent 20305 | af013cf4a5e6 |
child 30247 | 9925b07bba5b |
permissions | -rw-r--r-- |
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
1 |
/* |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
4 |
* |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
8 |
* |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
13 |
* accompanied this code). |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
14 |
* |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
18 |
* |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
21 |
* questions. |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
22 |
*/ |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
23 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
24 |
/* |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
25 |
* Common helpers for TestSummarizeRSetStats* tests |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
26 |
*/ |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
27 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
28 |
import sun.management.ManagementFactoryHelper; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
29 |
import com.sun.management.HotSpotDiagnosticMXBean; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
30 |
import com.sun.management.VMOption; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
31 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
32 |
import com.oracle.java.testlibrary.*; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
33 |
import java.util.regex.Matcher; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
34 |
import java.util.regex.Pattern; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
35 |
import java.lang.Thread; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
36 |
import java.util.ArrayList; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
37 |
import java.util.Arrays; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
38 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
39 |
class VerifySummaryOutput { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
40 |
// 4M size, both are directly allocated into the old gen |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
41 |
static Object[] largeObject1 = new Object[1024 * 1024]; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
42 |
static Object[] largeObject2 = new Object[1024 * 1024]; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
43 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
44 |
static int[] temp; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
45 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
46 |
public static void main(String[] args) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
47 |
// create some cross-references between these objects |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
48 |
for (int i = 0; i < largeObject1.length; i++) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
49 |
largeObject1[i] = largeObject2; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
50 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
51 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
52 |
for (int i = 0; i < largeObject2.length; i++) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
53 |
largeObject2[i] = largeObject1; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
54 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
55 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
56 |
int numGCs = Integer.parseInt(args[0]); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
57 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
58 |
if (numGCs > 0) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
59 |
// try to force a minor collection: the young gen is 4M, the |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
60 |
// amount of data allocated below is roughly that (4*1024*1024 + |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
61 |
// some header data) |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
62 |
for (int i = 0; i < 1024 ; i++) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
63 |
temp = new int[1024]; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
64 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
65 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
66 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
67 |
for (int i = 0; i < numGCs - 1; i++) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
68 |
System.gc(); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
69 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
70 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
71 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
72 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
73 |
public class TestSummarizeRSetStatsTools { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
74 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
75 |
// the VM is currently run using G1GC, i.e. trying to test G1 functionality. |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
76 |
public static boolean testingG1GC() { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
77 |
HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
78 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
79 |
VMOption option = diagnostic.getVMOption("UseG1GC"); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
80 |
if (option.getValue().equals("false")) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
81 |
System.out.println("Skipping this test. It is only a G1 test."); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
82 |
return false; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
83 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
84 |
return true; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
85 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
86 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
87 |
public static String runTest(String[] additionalArgs, int numGCs) throws Exception { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
88 |
ArrayList<String> finalargs = new ArrayList<String>(); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
89 |
String[] defaultArgs = new String[] { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
90 |
"-XX:+UseG1GC", |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
91 |
"-Xmn4m", |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
92 |
"-Xmx20m", |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
93 |
"-XX:InitiatingHeapOccupancyPercent=100", // we don't want the additional GCs due to initial marking |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
94 |
"-XX:+PrintGC", |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
95 |
"-XX:+UnlockDiagnosticVMOptions", |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
96 |
"-XX:G1HeapRegionSize=1M", |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
97 |
}; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
98 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
99 |
finalargs.addAll(Arrays.asList(defaultArgs)); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
100 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
101 |
if (additionalArgs != null) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
102 |
finalargs.addAll(Arrays.asList(additionalArgs)); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
103 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
104 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
105 |
finalargs.add(VerifySummaryOutput.class.getName()); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
106 |
finalargs.add(String.valueOf(numGCs)); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
107 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
108 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
109 |
finalargs.toArray(new String[0])); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
110 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
111 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
112 |
output.shouldHaveExitValue(0); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
113 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
114 |
String result = output.getStdout(); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
115 |
return result; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
116 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
117 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
118 |
private static void checkCounts(int expected, int actual, String which) throws Exception { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
119 |
if (expected != actual) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
120 |
throw new Exception("RSet summaries mention " + which + " regions an incorrect number of times. Expected " + expected + ", got " + actual); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
121 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
122 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
123 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
124 |
public static void expectPerRegionRSetSummaries(String result, int expectedCumulative, int expectedPeriodic) throws Exception { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
125 |
expectRSetSummaries(result, expectedCumulative, expectedPeriodic); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
126 |
int actualYoung = result.split("Young regions").length - 1; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
127 |
int actualHumonguous = result.split("Humonguous regions").length - 1; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
128 |
int actualFree = result.split("Free regions").length - 1; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
129 |
int actualOther = result.split("Old regions").length - 1; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
130 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
131 |
// the strings we check for above are printed four times per summary |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
132 |
int expectedPerRegionTypeInfo = (expectedCumulative + expectedPeriodic) * 4; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
133 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
134 |
checkCounts(expectedPerRegionTypeInfo, actualYoung, "Young"); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
135 |
checkCounts(expectedPerRegionTypeInfo, actualHumonguous, "Humonguous"); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
136 |
checkCounts(expectedPerRegionTypeInfo, actualFree, "Free"); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
137 |
checkCounts(expectedPerRegionTypeInfo, actualOther, "Old"); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
138 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
139 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
140 |
public static void expectRSetSummaries(String result, int expectedCumulative, int expectedPeriodic) throws Exception { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
141 |
int actualTotal = result.split("concurrent refinement").length - 1; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
142 |
int actualCumulative = result.split("Cumulative RS summary").length - 1; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
143 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
144 |
if (expectedCumulative != actualCumulative) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
145 |
throw new Exception("Incorrect amount of RSet summaries at the end. Expected " + expectedCumulative + ", got " + actualCumulative); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
146 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
147 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
148 |
if (expectedPeriodic != (actualTotal - actualCumulative)) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
149 |
throw new Exception("Incorrect amount of per-period RSet summaries at the end. Expected " + expectedPeriodic + ", got " + (actualTotal - actualCumulative)); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
150 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
151 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
152 |
} |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff
changeset
|
153 |