Mercurial > hg > graal-compiler
annotate test/gc/g1/TestShrinkAuxiliaryData.java @ 21918:0ab08be12bbb
Merge
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Thu, 11 Jun 2015 11:35:55 +0200 |
parents | 7a6313074325 |
children |
rev | line source |
---|---|
20541
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
1 /* |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
4 * |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
8 * |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
13 * accompanied this code). |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
14 * |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
18 * |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
21 * questions. |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
22 */ |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
23 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
24 import static com.oracle.java.testlibrary.Asserts.assertLessThanOrEqual; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
25 import com.oracle.java.testlibrary.OutputAnalyzer; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
26 import com.oracle.java.testlibrary.Platform; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
27 import com.oracle.java.testlibrary.ProcessTools; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
28 import com.oracle.java.testlibrary.Utils; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
29 import java.io.IOException; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
30 import java.lang.management.ManagementFactory; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
31 import java.lang.management.MemoryUsage; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
32 import java.text.DecimalFormat; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
33 import java.text.DecimalFormatSymbols; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
34 import java.util.ArrayList; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
35 import java.util.Arrays; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
36 import java.util.Collections; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
37 import java.util.LinkedList; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
38 import java.util.List; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
39 import sun.misc.Unsafe; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
40 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
41 public class TestShrinkAuxiliaryData { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
42 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
43 private final static String[] initialOpts = new String[]{ |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
44 "-XX:MinHeapFreeRatio=10", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
45 "-XX:MaxHeapFreeRatio=11", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
46 "-XX:+UseG1GC", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
47 "-XX:G1HeapRegionSize=1m", |
20623
7a6313074325
8064716: TestHumongousShrinkHeap.java can not be run with -XX:+ExplicitGCInvokesConcurrent
azakharov
parents:
20541
diff
changeset
|
48 "-XX:-ExplicitGCInvokesConcurrent", |
20541
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
49 "-XX:+PrintGCDetails" |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
50 }; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
51 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
52 private final int RSetCacheSize; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
53 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
54 protected TestShrinkAuxiliaryData(int RSetCacheSize) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
55 this.RSetCacheSize = RSetCacheSize; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
56 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
57 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
58 protected void test() throws Exception { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
59 ArrayList<String> vmOpts = new ArrayList(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
60 Collections.addAll(vmOpts, initialOpts); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
61 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
62 int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize())); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
63 if (maxCacheSize < RSetCacheSize) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
64 System.out.format("Skiping test for %d cache size due max cache size %d", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
65 RSetCacheSize, maxCacheSize |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
66 ); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
67 return; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
68 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
69 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
70 printTestInfo(maxCacheSize); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
71 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
72 vmOpts.add("-XX:G1ConcRSLogCacheSize=" + RSetCacheSize); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
73 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
74 vmOpts.addAll(Arrays.asList(Utils.getFilteredTestJavaOpts( |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
75 ShrinkAuxiliaryDataTest.prohibitedVmOptions))); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
76 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
77 // for 32 bits ObjectAlignmentInBytes is not a option |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
78 if (Platform.is32bit()) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
79 ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
80 vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName()); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
81 performTest(vmOptsWithoutAlign); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
82 return; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
83 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
84 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
85 for (int alignment = 3; alignment <= 8; alignment++) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
86 ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
87 vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes=" |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
88 + (int) Math.pow(2, alignment)); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
89 vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName()); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
90 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
91 performTest(vmOptsWithAlign); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
92 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
93 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
94 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
95 private void performTest(List<String> opts) throws Exception { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
96 ProcessBuilder pb |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
97 = ProcessTools.createJavaProcessBuilder( |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
98 opts.toArray(new String[opts.size()]) |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
99 ); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
100 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
101 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
102 output.shouldHaveExitValue(0); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
103 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
104 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
105 private void printTestInfo(int maxCacheSize) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
106 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
107 DecimalFormat grouped = new DecimalFormat("000,000"); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
108 DecimalFormatSymbols formatSymbols = grouped.getDecimalFormatSymbols(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
109 formatSymbols.setGroupingSeparator(' '); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
110 grouped.setDecimalFormatSymbols(formatSymbols); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
111 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
112 System.out.format("Test will use %s bytes of memory of %s available%n" |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
113 + "Available memory is %s with %d bytes pointer size - can save %s pointers%n" |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
114 + "Max cache size: 2^%d = %s elements%n", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
115 grouped.format(ShrinkAuxiliaryDataTest.getMemoryUsedByTest()), |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
116 grouped.format(Runtime.getRuntime().freeMemory()), |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
117 grouped.format(Runtime.getRuntime().freeMemory() |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
118 - ShrinkAuxiliaryDataTest.getMemoryUsedByTest()), |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
119 Unsafe.ADDRESS_SIZE, |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
120 grouped.format((Runtime.getRuntime().freeMemory() |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
121 - ShrinkAuxiliaryDataTest.getMemoryUsedByTest()) |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
122 / Unsafe.ADDRESS_SIZE), |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
123 maxCacheSize, |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
124 grouped.format((int) Math.pow(2, maxCacheSize)) |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
125 ); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
126 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
127 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
128 /** |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
129 * Detects maximum possible size of G1ConcRSLogCacheSize available for |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
130 * current process based on maximum available process memory size |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
131 * |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
132 * @return power of two |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
133 */ |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
134 private static int getMaxCacheSize() { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
135 long availableMemory = Runtime.getRuntime().freeMemory() |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
136 - ShrinkAuxiliaryDataTest.getMemoryUsedByTest() - 1l; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
137 if (availableMemory <= 0) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
138 return 0; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
139 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
140 long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
141 return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount)); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
142 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
143 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
144 static class ShrinkAuxiliaryDataTest { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
145 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
146 public static void main(String[] args) throws IOException { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
147 int iterateCount = DEFAULT_ITERATION_COUNT; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
148 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
149 if (args.length > 0) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
150 try { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
151 iterateCount = Integer.parseInt(args[0]); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
152 } catch (NumberFormatException e) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
153 //num_iterate remains default |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
154 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
155 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
156 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
157 new ShrinkAuxiliaryDataTest().test(iterateCount); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
158 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
159 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
160 class GarbageObject { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
161 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
162 private final List<byte[]> payload = new ArrayList(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
163 private final List<GarbageObject> ref = new LinkedList(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
164 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
165 public GarbageObject(int size) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
166 payload.add(new byte[size]); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
167 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
168 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
169 public void addRef(GarbageObject g) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
170 ref.add(g); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
171 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
172 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
173 public void mutate() { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
174 if (!payload.isEmpty() && payload.get(0).length > 0) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
175 payload.get(0)[0] = (byte) (Math.random() * Byte.MAX_VALUE); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
176 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
177 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
178 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
179 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
180 private final List<GarbageObject> garbage = new ArrayList(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
181 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
182 public void test(int num_iterate) throws IOException { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
183 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
184 allocate(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
185 link(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
186 mutate(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
187 deallocate(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
188 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
189 MemoryUsage muBeforeHeap |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
190 = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
191 MemoryUsage muBeforeNonHeap |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
192 = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
193 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
194 for (int i = 0; i < num_iterate; i++) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
195 allocate(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
196 link(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
197 mutate(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
198 deallocate(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
199 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
200 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
201 System.gc(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
202 MemoryUsage muAfterHeap |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
203 = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
204 MemoryUsage muAfterNonHeap |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
205 = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
206 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
207 assertLessThanOrEqual(muAfterHeap.getCommitted(), muBeforeHeap.getCommitted(), |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
208 String.format("heap decommit failed - after > before: %d > %d", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
209 muAfterHeap.getCommitted(), muBeforeHeap.getCommitted() |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
210 ) |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
211 ); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
212 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
213 if (muAfterHeap.getCommitted() < muBeforeHeap.getCommitted()) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
214 assertLessThanOrEqual(muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted(), |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
215 String.format("non-heap decommit failed - after > before: %d > %d", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
216 muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted() |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
217 ) |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
218 ); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
219 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
220 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
221 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
222 private void allocate() { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
223 for (int r = 0; r < REGIONS_TO_ALLOCATE; r++) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
224 for (int i = 0; i < NUM_OBJECTS_PER_REGION; i++) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
225 GarbageObject g = new GarbageObject(REGION_SIZE |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
226 / NUM_OBJECTS_PER_REGION); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
227 garbage.add(g); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
228 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
229 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
230 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
231 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
232 /** |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
233 * Iterate through all allocated objects, and link to objects in another |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
234 * regions |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
235 */ |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
236 private void link() { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
237 for (int ig = 0; ig < garbage.size(); ig++) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
238 int regionNumber = ig / NUM_OBJECTS_PER_REGION; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
239 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
240 for (int i = 0; i < NUM_LINKS; i++) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
241 int regionToLink; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
242 do { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
243 regionToLink = (int) (Math.random() |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
244 * REGIONS_TO_ALLOCATE); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
245 } while (regionToLink == regionNumber); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
246 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
247 // get random garbage object from random region |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
248 garbage.get(ig).addRef(garbage.get(regionToLink |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
249 * NUM_OBJECTS_PER_REGION + (int) (Math.random() |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
250 * NUM_OBJECTS_PER_REGION))); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
251 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
252 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
253 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
254 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
255 private void mutate() { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
256 for (int ig = 0; ig < garbage.size(); ig++) { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
257 garbage.get(ig).mutate(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
258 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
259 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
260 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
261 private void deallocate() { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
262 garbage.clear(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
263 System.gc(); |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
264 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
265 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
266 static long getMemoryUsedByTest() { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
267 return REGIONS_TO_ALLOCATE * REGION_SIZE; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
268 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
269 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
270 private static final int REGION_SIZE = 1024 * 1024; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
271 private static final int DEFAULT_ITERATION_COUNT = 1; // iterate main scenario |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
272 private static final int REGIONS_TO_ALLOCATE = 5; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
273 private static final int NUM_OBJECTS_PER_REGION = 10; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
274 private static final int NUM_LINKS = 20; // how many links create for each object |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
275 |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
276 private static final String[] prohibitedVmOptions = { |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
277 // remove this when @requires option will be on duty |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
278 "-XX:\\+UseParallelGC", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
279 "-XX:\\+UseSerialGC", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
280 "-XX:\\+UseConcMarkSweepGC", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
281 "-XX:\\+UseParallelOldGC", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
282 "-XX:\\+UseParNewGC", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
283 "-Xconcgc", |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
284 "-Xincgc" |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
285 }; |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
286 } |
e3ed86fc15ed
8043766: CMM Testing: 8u40 Decommit auxiliary data structures
tschatzl
parents:
diff
changeset
|
287 } |