test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java
author hseigel
Thu, 11 Oct 2018 11:31:37 -0400
changeset 52097 8419d77e3635
permissions -rw-r--r--
8211821: PrintStringTableStatistics crashes JVM Summary: During JVM exit, print the Symbol and String tables before current thread gets deleted. Reviewed-by: iklam, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52097
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     1
/*
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     4
 *
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     8
 *
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    13
 * accompanied this code).
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    14
 *
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    18
 *
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    21
 * questions.
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    22
 */
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    23
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    24
import jdk.test.lib.process.ProcessTools;
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    25
import jdk.test.lib.process.OutputAnalyzer;
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    26
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    27
/*
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    28
 * @test PrintStringTableStatsTest
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    29
 * @bug 8211821
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    30
 * @library /test/lib
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    31
 * @run main PrintStringTableStatsTest
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    32
 */
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    33
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    34
public class PrintStringTableStatsTest {
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    35
    public static void main(String... args) throws Exception {
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    36
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    37
            "-XX:+PrintStringTableStatistics",
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    38
            "--version");
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    39
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    40
        output.shouldContain("Number of buckets");
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    41
        output.shouldHaveExitValue(0);
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    42
    }
8419d77e3635 8211821: PrintStringTableStatistics crashes JVM
hseigel
parents:
diff changeset
    43
}