hotspot/test/gc/g1/TestGCLogMessages.java
author ykantser
Thu, 26 Mar 2015 16:36:56 +0100
changeset 29678 dd2f3932c21e
parent 28497 a7aecf0ffb6b
child 29707 30263f16b395
permissions -rw-r--r--
8075586: Add @modules as needed to the open hotspot tests Reviewed-by: sla, ctornqvi, lfoltan, mchung, alanb Contributed-by: alexander.kulyakhtin@oracle.com
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
/*
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
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
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 25889
diff changeset
    26
 * @bug 8035406 8027295 8035398 8019342 8027959 8048179
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
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 28497
diff changeset
    31
 * @modules java.base/sun.misc
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 28497
diff changeset
    32
 *          java.management
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    33
 */
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    34
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    35
import com.oracle.java.testlibrary.ProcessTools;
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    36
import com.oracle.java.testlibrary.OutputAnalyzer;
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    37
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    38
public class TestGCLogMessages {
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    39
  public static void main(String[] args) throws Exception {
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
    40
    testNormalLogs();
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
    41
    testWithToSpaceExhaustionLogs();
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
    42
  }
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
    43
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
    44
  private static void testNormalLogs() throws Exception {
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    45
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    46
    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    47
                                                              "-Xmx10M",
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    48
                                                              GCTest.class.getName());
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    49
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    50
    OutputAnalyzer output = new OutputAnalyzer(pb.start());
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    51
23454
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23453
diff changeset
    52
    output.shouldNotContain("[Redirty Cards");
24104
febf9363fb68 8019342: G1: High "Other" time most likely due to card redirtying
tschatzl
parents: 23472
diff changeset
    53
    output.shouldNotContain("[Parallel Redirty");
febf9363fb68 8019342: G1: High "Other" time most likely due to card redirtying
tschatzl
parents: 23472
diff changeset
    54
    output.shouldNotContain("[Redirtied Cards");
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    55
    output.shouldNotContain("[Code Root Purge");
23472
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
    56
    output.shouldNotContain("[String Dedup Fixup");
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    57
    output.shouldNotContain("[Young Free CSet");
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    58
    output.shouldNotContain("[Non-Young Free CSet");
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 25889
diff changeset
    59
    output.shouldNotContain("[Humongous Register");
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 24467
diff changeset
    60
    output.shouldNotContain("[Humongous Reclaim");
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    61
    output.shouldHaveExitValue(0);
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    62
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    63
    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
23472
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
    64
                                               "-XX:+UseStringDeduplication",
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    65
                                               "-Xmx10M",
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    66
                                               "-XX:+PrintGCDetails",
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    67
                                               GCTest.class.getName());
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    68
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    69
    output = new OutputAnalyzer(pb.start());
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    70
23454
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23453
diff changeset
    71
    output.shouldContain("[Redirty Cards");
24104
febf9363fb68 8019342: G1: High "Other" time most likely due to card redirtying
tschatzl
parents: 23472
diff changeset
    72
    output.shouldNotContain("[Parallel Redirty");
febf9363fb68 8019342: G1: High "Other" time most likely due to card redirtying
tschatzl
parents: 23472
diff changeset
    73
    output.shouldNotContain("[Redirtied Cards");
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    74
    output.shouldContain("[Code Root Purge");
23472
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
    75
    output.shouldContain("[String Dedup Fixup");
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    76
    output.shouldNotContain("[Young Free CSet");
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    77
    output.shouldNotContain("[Non-Young Free CSet");
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 25889
diff changeset
    78
    output.shouldContain("[Humongous Register");
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 24467
diff changeset
    79
    output.shouldNotContain("[Humongous Total");
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 24467
diff changeset
    80
    output.shouldNotContain("[Humongous Candidate");
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 25889
diff changeset
    81
    output.shouldContain("[Humongous Reclaim");
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 24467
diff changeset
    82
    output.shouldNotContain("[Humongous Reclaimed");
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    83
    output.shouldHaveExitValue(0);
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    84
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    85
    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
23472
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
    86
                                               "-XX:+UseStringDeduplication",
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    87
                                               "-Xmx10M",
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    88
                                               "-XX:+PrintGCDetails",
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    89
                                               "-XX:+UnlockExperimentalVMOptions",
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    90
                                               "-XX:G1LogLevel=finest",
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    91
                                               GCTest.class.getName());
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    92
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    93
    output = new OutputAnalyzer(pb.start());
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    94
23454
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23453
diff changeset
    95
    output.shouldContain("[Redirty Cards");
24104
febf9363fb68 8019342: G1: High "Other" time most likely due to card redirtying
tschatzl
parents: 23472
diff changeset
    96
    output.shouldContain("[Parallel Redirty");
febf9363fb68 8019342: G1: High "Other" time most likely due to card redirtying
tschatzl
parents: 23472
diff changeset
    97
    output.shouldContain("[Redirtied Cards");
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
    98
    output.shouldContain("[Code Root Purge");
23472
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
    99
    output.shouldContain("[String Dedup Fixup");
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
   100
    output.shouldContain("[Young Free CSet");
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
   101
    output.shouldContain("[Non-Young Free CSet");
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 25889
diff changeset
   102
    output.shouldContain("[Humongous Register");
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 24467
diff changeset
   103
    output.shouldContain("[Humongous Total");
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 24467
diff changeset
   104
    output.shouldContain("[Humongous Candidate");
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 25889
diff changeset
   105
    output.shouldContain("[Humongous Reclaim");
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 24467
diff changeset
   106
    output.shouldContain("[Humongous Reclaimed");
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   107
    output.shouldHaveExitValue(0);
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   108
  }
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   109
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   110
  private static void testWithToSpaceExhaustionLogs() throws Exception {
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   111
    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
28497
a7aecf0ffb6b 8067941: [TESTBUG] Fix tests for OS with 64K page size.
goetz
parents: 28379
diff changeset
   112
                                               "-Xmx32M",
a7aecf0ffb6b 8067941: [TESTBUG] Fix tests for OS with 64K page size.
goetz
parents: 28379
diff changeset
   113
                                               "-Xmn16M",
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   114
                                               "-XX:+PrintGCDetails",
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   115
                                               GCTestWithToSpaceExhaustion.class.getName());
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   116
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   117
    OutputAnalyzer output = new OutputAnalyzer(pb.start());
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   118
    output.shouldContain("[Evacuation Failure");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   119
    output.shouldNotContain("[Recalculate Used");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   120
    output.shouldNotContain("[Remove Self Forwards");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   121
    output.shouldNotContain("[Restore RemSet");
23453
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
   122
    output.shouldHaveExitValue(0);
09cfb0164acf 8027295: Free CSet takes ~50% of young pause time
tschatzl
parents: 23451
diff changeset
   123
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   124
    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
28497
a7aecf0ffb6b 8067941: [TESTBUG] Fix tests for OS with 64K page size.
goetz
parents: 28379
diff changeset
   125
                                               "-Xmx32M",
a7aecf0ffb6b 8067941: [TESTBUG] Fix tests for OS with 64K page size.
goetz
parents: 28379
diff changeset
   126
                                               "-Xmn16M",
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   127
                                               "-XX:+PrintGCDetails",
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   128
                                               "-XX:+UnlockExperimentalVMOptions",
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   129
                                               "-XX:G1LogLevel=finest",
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   130
                                               GCTestWithToSpaceExhaustion.class.getName());
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   131
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   132
    output = new OutputAnalyzer(pb.start());
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   133
    output.shouldContain("[Evacuation Failure");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   134
    output.shouldContain("[Recalculate Used");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   135
    output.shouldContain("[Remove Self Forwards");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   136
    output.shouldContain("[Restore RemSet");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   137
    output.shouldHaveExitValue(0);
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   138
  }
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   139
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   140
  static class GCTest {
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   141
    private static byte[] garbage;
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   142
    public static void main(String [] args) {
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   143
      System.out.println("Creating garbage");
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   144
      // create 128MB of garbage. This should result in at least one GC
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   145
      for (int i = 0; i < 1024; i++) {
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   146
        garbage = new byte[128 * 1024];
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   147
      }
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   148
      System.out.println("Done");
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   149
    }
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   150
  }
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   151
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   152
  static class GCTestWithToSpaceExhaustion {
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   153
    private static byte[] garbage;
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   154
    private static byte[] largeObject;
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   155
    public static void main(String [] args) {
28497
a7aecf0ffb6b 8067941: [TESTBUG] Fix tests for OS with 64K page size.
goetz
parents: 28379
diff changeset
   156
      largeObject = new byte[16*1024*1024];
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   157
      System.out.println("Creating garbage");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   158
      // create 128MB of garbage. This should result in at least one GC,
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   159
      // some of them with to-space exhaustion.
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   160
      for (int i = 0; i < 1024; i++) {
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   161
        garbage = new byte[128 * 1024];
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   162
      }
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   163
      System.out.println("Done");
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   164
    }
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   165
  }
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   166
}