hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java
author tschatzl
Thu, 26 Sep 2013 12:49:45 +0200
changeset 20305 af013cf4a5e6
child 29678 dd2f3932c21e
permissions -rw-r--r--
8014078: G1: improve remembered set summary information by providing per region type information Summary: Add memory consumption breakdown on a per region type in the G1 remembered set summary statistics. This simplifies remembered set memory consumption analysis. Reviewed-by: brutisso
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     1
/*
af013cf4a5e6 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.
af013cf4a5e6 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.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     4
 *
af013cf4a5e6 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
af013cf4a5e6 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
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     7
 * published by the Free Software Foundation.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     8
 *
af013cf4a5e6 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
af013cf4a5e6 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
af013cf4a5e6 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
af013cf4a5e6 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
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    13
 * accompanied this code).
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    14
 *
af013cf4a5e6 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
af013cf4a5e6 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,
af013cf4a5e6 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.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    18
 *
af013cf4a5e6 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
af013cf4a5e6 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
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    21
 * questions.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    22
 */
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    23
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    24
/*
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    25
 * @test TestSummarizeRSetStatsPerRegion.java
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    26
 * @bug 8014078
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    27
 * @library /testlibrary
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    28
 * @build TestSummarizeRSetStatsTools TestSummarizeRSetStatsPerRegion
af013cf4a5e6 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
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    30
 * @run main TestSummarizeRSetStatsPerRegion
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    31
 */
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    32
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    33
import com.oracle.java.testlibrary.*;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    34
import java.lang.Thread;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    35
import java.util.ArrayList;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    36
import java.util.Arrays;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    37
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    38
public class TestSummarizeRSetStatsPerRegion {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    39
af013cf4a5e6 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 {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    41
        String result;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    42
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    43
        if (!TestSummarizeRSetStatsTools.testingG1GC()) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    44
            return;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    45
        }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    46
af013cf4a5e6 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
af013cf4a5e6 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);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    49
        TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 0);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    50
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    51
        // two times remembered set summary output
af013cf4a5e6 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);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    53
        TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 2);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    54
    }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    55
}