author | alanb |
Tue, 03 May 2016 09:11:31 +0100 | |
changeset 37827 | 09fa0c82a5f7 |
parent 36851 | 03e2f4d0a421 |
child 39414 | 4adf52148100 |
permissions | -rw-r--r-- |
28026
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
1 |
/* |
36576 | 2 |
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
28026
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
4 |
* |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
8 |
* |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
13 |
* accompanied this code). |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
14 |
* |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
18 |
* |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
21 |
* questions. |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
22 |
*/ |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
23 |
|
30604
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
24 |
import jdk.test.lib.JDKToolFinder; |
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
25 |
import jdk.test.lib.OutputAnalyzer; |
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
26 |
import jdk.test.lib.ProcessTools; |
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
27 |
import jdk.test.lib.Platform; |
28026
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
28 |
|
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
29 |
/* |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
30 |
* @test TestCardTablePageCommits |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
31 |
* @key gc |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
32 |
* @bug 8059066 |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
33 |
* @summary Tests that the card table does not commit the same page twice |
36576 | 34 |
* @requires vm.gc=="Parallel" | vm.gc=="null" |
28026
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
35 |
* @library /testlibrary |
36851 | 36 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28026
diff
changeset
|
37 |
* java.management |
28026
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
38 |
* @run driver TestCardTablePageCommits |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
39 |
*/ |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
40 |
public class TestCardTablePageCommits { |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
41 |
public static void main(String args[]) throws Exception { |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
42 |
// The test is run with a small heap to make sure all pages in the card |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
43 |
// table gets committed. Need 8 MB heap to trigger the bug on SPARC |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
44 |
// because of 8kB pages, assume 4 KB pages for all other CPUs. |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
45 |
String Xmx = Platform.isSparc() ? "-Xmx8m" : "-Xmx4m"; |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
46 |
|
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
47 |
String[] opts = {Xmx, "-XX:NativeMemoryTracking=detail", "-XX:+UseParallelGC", "-version"}; |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
48 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(opts); |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
49 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
50 |
output.shouldHaveExitValue(0); |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
51 |
} |
3694b71eef6c
8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff
changeset
|
52 |
} |