annotate test/gc/g1/TestStringSymbolTableStats.java @ 20304:a22acf6d7598

8048112: G1 Full GC needs to support the case when the very first region is not available Summary: Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett. Reviewed-by: brutisso
author tschatzl
date Mon, 21 Jul 2014 10:00:31 +0200
parents 5a32d2a3cc1e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17634
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
1 /*
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
4 *
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
7 * published by the Free Software Foundation.
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
8 *
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
13 * accompanied this code).
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
14 *
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
18 *
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
21 * questions.
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
22 */
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
23
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
24 /*
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
25 * @test TestStringSymbolTableStats.java
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
26 * @bug 8027476 8027455
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
27 * @summary Ensure that the G1TraceStringSymbolTableScrubbing prints the expected message.
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
28 * @key gc
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
29 * @library /testlibrary
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
30 */
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
31
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
32 import com.oracle.java.testlibrary.ProcessTools;
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
33 import com.oracle.java.testlibrary.OutputAnalyzer;
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
34
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
35 public class TestStringSymbolTableStats {
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
36 public static void main(String[] args) throws Exception {
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
37
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
38 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
39 "-XX:+UnlockExperimentalVMOptions",
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
40 "-XX:+G1TraceStringSymbolTableScrubbing",
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
41 SystemGCTest.class.getName());
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
42
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
43 OutputAnalyzer output = new OutputAnalyzer(pb.start());
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
44
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
45 System.out.println("Output:\n" + output.getOutput());
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
46
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
47 output.shouldContain("Cleaned string and symbol table");
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
48 output.shouldHaveExitValue(0);
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
49 }
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
50
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
51 static class SystemGCTest {
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
52 public static void main(String [] args) {
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
53 System.out.println("Calling System.gc()");
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
54 System.gc();
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
55 }
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
56 }
5a32d2a3cc1e 8027476: Improve performance of Stringtable unlink
tschatzl
parents:
diff changeset
57 }