author | mchernov |
Mon, 08 Feb 2016 18:54:09 +0300 | |
changeset 35947 | 48c797584ac2 |
parent 35885 | 6e62be7db2c8 |
child 38726 | 2c99beca1dd8 |
permissions | -rw-r--r-- |
35885 | 1 |
/* |
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
package gc.g1.plab.lib; |
|
24 |
||
25 |
import java.util.ArrayList; |
|
26 |
import java.util.Arrays; |
|
27 |
import java.util.Collections; |
|
28 |
import java.util.List; |
|
29 |
import jdk.test.lib.Utils; |
|
30 |
||
31 |
/** |
|
32 |
* Utilities for PLAB testing. |
|
33 |
*/ |
|
34 |
public class PLABUtils { |
|
35 |
||
36 |
/** |
|
37 |
* PLAB tests default options list |
|
38 |
*/ |
|
39 |
private final static String[] GC_TUNE_OPTIONS = { |
|
40 |
"-XX:+UseG1GC", |
|
41 |
"-XX:G1HeapRegionSize=1m", |
|
42 |
"-XX:OldSize=64m", |
|
43 |
"-XX:-UseAdaptiveSizePolicy", |
|
35947
48c797584ac2
8148745: [testbug] Test gc/g1/plab/TestPLABPromotion.java fails in nightly
mchernov
parents:
35885
diff
changeset
|
44 |
"-XX:MaxTenuringThreshold=1", |
35885 | 45 |
"-XX:-UseTLAB", |
46 |
"-XX:SurvivorRatio=1" |
|
47 |
}; |
|
48 |
||
49 |
/** |
|
50 |
* GC logging options list. |
|
51 |
*/ |
|
52 |
private final static String G1_PLAB_LOGGING_OPTIONS[] = { |
|
53 |
"-Xlog:gc=debug,gc+plab=debug" |
|
54 |
}; |
|
55 |
||
56 |
/** |
|
57 |
* List of options required to use WhiteBox. |
|
58 |
*/ |
|
59 |
private final static String WB_DIAGNOSTIC_OPTIONS[] = { |
|
60 |
"-Xbootclasspath/a:.", |
|
61 |
"-XX:+UnlockDiagnosticVMOptions", |
|
62 |
"-XX:+WhiteBoxAPI" |
|
63 |
}; |
|
64 |
||
65 |
/** |
|
66 |
* Prepares options for testing. |
|
67 |
* |
|
68 |
* @param options - additional options for testing |
|
69 |
* @return List of options |
|
70 |
*/ |
|
71 |
public static List<String> prepareOptions(List<String> options) { |
|
72 |
if (options == null) { |
|
73 |
throw new IllegalArgumentException("Options cannot be null"); |
|
74 |
} |
|
75 |
List<String> executionOtions = new ArrayList<>( |
|
76 |
Arrays.asList(Utils.getTestJavaOpts()) |
|
77 |
); |
|
78 |
Collections.addAll(executionOtions, WB_DIAGNOSTIC_OPTIONS); |
|
79 |
Collections.addAll(executionOtions, G1_PLAB_LOGGING_OPTIONS); |
|
80 |
Collections.addAll(executionOtions, GC_TUNE_OPTIONS); |
|
81 |
executionOtions.addAll(options); |
|
82 |
return executionOtions; |
|
83 |
} |
|
84 |
} |