author | sangheki |
Thu, 10 Aug 2017 18:09:19 -0700 | |
changeset 46795 | 623a5e42deb6 |
parent 42595 | b1ae41a4eae9 |
permissions | -rw-r--r-- |
42595
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
1 |
/* |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
4 |
* |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
8 |
* |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
13 |
* accompanied this code). |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
14 |
* |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
18 |
* |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
21 |
* questions. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
22 |
*/ |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
23 |
|
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
24 |
/* |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
25 |
* @test |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
26 |
* @bug 8169703 |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
27 |
* @summary Regression test to ensure AlwaysPreTouch with multiple threads works at mutator time. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
28 |
* Allocates a few humongous objects that will be allocated by expanding the heap, causing concurrent parallel |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
29 |
* pre-touch. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
30 |
* @requires vm.gc.G1 |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
31 |
* @key gc |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
32 |
* @key regression |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
33 |
* @run main/othervm -XX:+UseG1GC -Xms10M -Xmx100m -XX:G1HeapRegionSize=1M -XX:+AlwaysPreTouch -XX:PreTouchParallelChunkSize=512k -Xlog:gc+ergo+heap=debug,gc+heap=debug,gc=debug TestParallelAlwaysPreTouch |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
34 |
*/ |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
35 |
|
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
36 |
public class TestParallelAlwaysPreTouch { |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
37 |
public static void main(String[] args) throws Exception { |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
38 |
final int M = 1024 * 1024; // Something guaranteed to be larger than a region to be counted as humongous. |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
39 |
|
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
40 |
for (int i = 0; i < 10; i++) { |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
41 |
Object[] obj = new Object[M]; |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
42 |
System.out.println(obj); |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
43 |
} |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
44 |
} |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
45 |
} |
b1ae41a4eae9
8169703: G1 crashes with guarantee(pretouch_gang != NULL) failed: No pretouch gang specified
tschatzl
parents:
diff
changeset
|
46 |