hotspot/test/gc/g1/TestGCLogMessages.java
author brutisso
Thu, 19 Mar 2015 15:25:54 +0100
changeset 29694 442c3305ba39
parent 28497 a7aecf0ffb6b
child 29707 30263f16b395
permissions -rw-r--r--
8027962: Per-phase timing measurements for strong roots processing Reviewed-by: tschatzl, ecaspole
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     1
/*
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
     2
 * Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     4
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     8
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    13
 * accompanied this code).
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    14
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    18
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    21
 * questions.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    22
 */
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    23
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    24
/*
24467
886598231964 8038928: gc/g1/TestGCLogMessages.java fail with "[Evacuation Failure'
jmasa
parents: 24104
diff changeset
    25
 * @test TestGCLogMessages
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    26
 * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    27
 * @summary Ensure that the PrintGCDetails output for a minor GC with G1
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    28
 * includes the expected necessary messages.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    29
 * @key gc
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    30
 * @library /testlibrary
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    31
 */
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    32
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    33
import com.oracle.java.testlibrary.ProcessTools;
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    34
import com.oracle.java.testlibrary.OutputAnalyzer;
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    35
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    36
public class TestGCLogMessages {
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
    37
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    38
    private enum Level {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    39
        OFF, FINER, FINEST;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    40
        public boolean lessOrEqualTo(Level other) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    41
            return this.compareTo(other) < 0;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    42
        }
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    43
    }
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    44
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    45
    private class LogMessageWithLevel {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    46
        String message;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    47
        Level level;
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    48
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    49
        public LogMessageWithLevel(String message, Level level) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    50
            this.message = message;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    51
            this.level = level;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    52
        }
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    53
    };
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    54
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    55
    private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    56
        // Ext Root Scan
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    57
        new LogMessageWithLevel("Thread Roots (ms)", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    58
        new LogMessageWithLevel("StringTable Roots (ms)", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    59
        new LogMessageWithLevel("Universe Roots (ms)", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    60
        new LogMessageWithLevel("JNI Handles Roots (ms)", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    61
        new LogMessageWithLevel("ObjectSynchronizer Roots (ms)", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    62
        new LogMessageWithLevel("FlatProfiler Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    63
        new LogMessageWithLevel("Management Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    64
        new LogMessageWithLevel("SystemDictionary Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    65
        new LogMessageWithLevel("CLDG Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    66
        new LogMessageWithLevel("JVMTI Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    67
        new LogMessageWithLevel("CodeCache Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    68
        new LogMessageWithLevel("SATB Filtering", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    69
        new LogMessageWithLevel("CM RefProcessor Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    70
        new LogMessageWithLevel("Wait For Strong CLD", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    71
        new LogMessageWithLevel("Weak CLD Roots", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    72
        // Redirty Cards
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    73
        new LogMessageWithLevel("Redirty Cards", Level.FINER),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    74
        new LogMessageWithLevel("Parallel Redirty", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    75
        new LogMessageWithLevel("Redirtied Cards", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    76
        // Misc Top-level
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    77
        new LogMessageWithLevel("Code Root Purge", Level.FINER),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    78
        new LogMessageWithLevel("String Dedup Fixup", Level.FINER),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    79
        // Free CSet
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    80
        new LogMessageWithLevel("Young Free CSet", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    81
        new LogMessageWithLevel("Non-Young Free CSet", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    82
        // Humongous Eager Reclaim
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    83
        new LogMessageWithLevel("Humongous Reclaim", Level.FINER),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    84
        new LogMessageWithLevel("Humongous Register", Level.FINER),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    85
    };
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    86
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    87
    void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    88
        for (LogMessageWithLevel l : messages) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    89
            if (level.lessOrEqualTo(l.level)) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    90
                output.shouldNotContain(l.message);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    91
            } else {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    92
                output.shouldContain(l.message);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    93
            }
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    94
        }
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    95
    }
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    96
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    97
    public static void main(String[] args) throws Exception {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    98
        new TestGCLogMessages().testNormalLogs();
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
    99
        new TestGCLogMessages().testWithToSpaceExhaustionLogs();
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   100
    }
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   101
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   102
    private void testNormalLogs() throws Exception {
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
   103
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   104
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   105
                                                                  "-Xmx10M",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   106
                                                                  GCTest.class.getName());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   107
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   108
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   109
        checkMessagesAtLevel(output, allLogMessages, Level.OFF);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   110
        output.shouldHaveExitValue(0);
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
   111
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   112
        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   113
                                                   "-XX:+UseStringDeduplication",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   114
                                                   "-Xmx10M",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   115
                                                   "-XX:+PrintGCDetails",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   116
                                                   GCTest.class.getName());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   117
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   118
        output = new OutputAnalyzer(pb.start());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   119
        checkMessagesAtLevel(output, allLogMessages, Level.FINER);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   120
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   121
        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   122
                                                   "-XX:+UseStringDeduplication",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   123
                                                   "-Xmx10M",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   124
                                                   "-XX:+PrintGCDetails",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   125
                                                   "-XX:+UnlockExperimentalVMOptions",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   126
                                                   "-XX:G1LogLevel=finest",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   127
                                                   GCTest.class.getName());
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   128
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   129
        output = new OutputAnalyzer(pb.start());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   130
        checkMessagesAtLevel(output, allLogMessages, Level.FINEST);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   131
        output.shouldHaveExitValue(0);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   132
    }
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   133
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   134
    LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   135
        new LogMessageWithLevel("Evacuation Failure", Level.FINER),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   136
        new LogMessageWithLevel("Recalculate Used", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   137
        new LogMessageWithLevel("Remove Self Forwards", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   138
        new LogMessageWithLevel("Restore RemSet", Level.FINEST),
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   139
    };
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   140
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   141
    private void testWithToSpaceExhaustionLogs() throws Exception {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   142
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   143
                                                                  "-Xmx32M",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   144
                                                                  "-Xmn16M",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   145
                                                                  "-XX:+PrintGCDetails",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   146
                                                                  GCTestWithToSpaceExhaustion.class.getName());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   147
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   148
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   149
        checkMessagesAtLevel(output, exhFailureMessages, Level.FINER);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   150
        output.shouldHaveExitValue(0);
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
   151
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   152
        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   153
                                                   "-Xmx32M",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   154
                                                   "-Xmn16M",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   155
                                                   "-XX:+PrintGCDetails",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   156
                                                   "-XX:+UnlockExperimentalVMOptions",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   157
                                                   "-XX:G1LogLevel=finest",
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   158
                                                   GCTestWithToSpaceExhaustion.class.getName());
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   159
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   160
        output = new OutputAnalyzer(pb.start());
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   161
        checkMessagesAtLevel(output, exhFailureMessages, Level.FINEST);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   162
        output.shouldHaveExitValue(0);
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   163
    }
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   164
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   165
    static class GCTest {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   166
        private static byte[] garbage;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   167
        public static void main(String [] args) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   168
            System.out.println("Creating garbage");
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   169
            // create 128MB of garbage. This should result in at least one GC
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   170
            for (int i = 0; i < 1024; i++) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   171
                garbage = new byte[128 * 1024];
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   172
            }
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   173
            System.out.println("Done");
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   174
        }
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   175
    }
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   176
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   177
    static class GCTestWithToSpaceExhaustion {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   178
        private static byte[] garbage;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   179
        private static byte[] largeObject;
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   180
        public static void main(String [] args) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   181
            largeObject = new byte[16*1024*1024];
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   182
            System.out.println("Creating garbage");
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   183
            // create 128MB of garbage. This should result in at least one GC,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   184
            // some of them with to-space exhaustion.
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   185
            for (int i = 0; i < 1024; i++) {
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   186
                garbage = new byte[128 * 1024];
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   187
            }
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   188
            System.out.println("Done");
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   189
        }
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   190
    }
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   191
}
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 28497
diff changeset
   192