annotate test/gc/g1/TestSummarizeRSetStatsPerRegion.java @ 17840:fd8ddf2d2f6b

8038461: Test gc/g1/TestStringDeduplicationMemoryUsage.java fails with unexpected memory usage Reviewed-by: jmasa, sjohanss
author pliden
date Thu, 03 Apr 2014 10:39:27 +0200
parents c319b188c7b2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12339
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
1 /*
c319b188c7b2 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.
c319b188c7b2 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.
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
4 *
c319b188c7b2 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
c319b188c7b2 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
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
7 * published by the Free Software Foundation.
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
8 *
c319b188c7b2 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
c319b188c7b2 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
c319b188c7b2 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
c319b188c7b2 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
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
13 * accompanied this code).
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
14 *
c319b188c7b2 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
c319b188c7b2 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,
c319b188c7b2 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.
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
18 *
c319b188c7b2 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
c319b188c7b2 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
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
21 * questions.
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
22 */
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
23
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
24 /*
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
25 * @test TestSummarizeRSetStatsPerRegion.java
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
26 * @bug 8014078
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
27 * @library /testlibrary
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
28 * @build TestSummarizeRSetStatsTools TestSummarizeRSetStatsPerRegion
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
29 * @summary Verify output of -XX:+G1SummarizeRSetStats in regards to per-region type output
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
30 * @run main TestSummarizeRSetStatsPerRegion
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
31 */
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
32
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
33 import com.oracle.java.testlibrary.*;
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
34 import java.lang.Thread;
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
35 import java.util.ArrayList;
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
36 import java.util.Arrays;
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
37
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
38 public class TestSummarizeRSetStatsPerRegion {
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
39
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
40 public static void main(String[] args) throws Exception {
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
41 String result;
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
42
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
43 if (!TestSummarizeRSetStatsTools.testingG1GC()) {
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
44 return;
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
45 }
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
46
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
47 // single remembered set summary output at the end
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
48 result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0);
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
49 TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 0);
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
50
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
51 // two times remembered set summary output
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
52 result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1);
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
53 TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 2);
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
54 }
c319b188c7b2 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
55 }