author | fmatte |
Tue, 02 Jul 2019 08:43:44 -0700 | |
changeset 55647 | f60890de1dfb |
child 58364 | 2c87d191056c |
permissions | -rw-r--r-- |
55647
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
1 |
/* |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
2 |
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
4 |
* |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
8 |
* |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
13 |
* accompanied this code). |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
14 |
* |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
18 |
* |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
21 |
* questions. |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
22 |
*/ |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
23 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
24 |
/** |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
25 |
* @test |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
26 |
* @bug 8225715 |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
27 |
* @requires vm.hasSAandCanAttach |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
28 |
* @library /test/lib |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
29 |
* @compile JShellHeapDumpTest.java |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
30 |
* @run main/timeout=240 JShellHeapDumpTest |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
31 |
*/ |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
32 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
33 |
import static jdk.test.lib.Asserts.assertTrue; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
34 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
35 |
import java.io.IOException; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
36 |
import java.io.File; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
37 |
import java.util.List; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
38 |
import java.util.Arrays; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
39 |
import java.util.Map; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
40 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
41 |
import jdk.test.lib.JDKToolLauncher; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
42 |
import jdk.test.lib.process.OutputAnalyzer; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
43 |
import jdk.test.lib.process.ProcessTools; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
44 |
import jdk.test.lib.hprof.parser.HprofReader; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
45 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
46 |
import jdk.jshell.JShell; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
47 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
48 |
public class JShellHeapDumpTest { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
49 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
50 |
protected static Process process; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
51 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
52 |
private static long pid; |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
53 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
54 |
public static void launch(String expectedMessage, List<String> toolArgs) |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
55 |
throws IOException { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
56 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
57 |
try { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
58 |
launchJshell(); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
59 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
60 |
System.out.println("Starting " + toolArgs.get(0) + " against " + pid); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
61 |
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
62 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
63 |
for (String cmd : toolArgs) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
64 |
launcher.addToolArg(cmd); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
65 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
66 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
67 |
launcher.addToolArg("--pid=" + Long.toString(pid)); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
68 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
69 |
ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand()); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
70 |
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
71 |
OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
72 |
System.out.println("stdout:"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
73 |
System.out.println(output.getStdout()); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
74 |
System.out.println("stderr:"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
75 |
System.out.println(output.getStderr()); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
76 |
output.shouldNotContain("null"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
77 |
output.shouldHaveExitValue(0); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
78 |
} catch (Exception ex) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
79 |
throw new RuntimeException("Test ERROR " + ex, ex); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
80 |
} finally { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
81 |
if (process.isAlive()) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
82 |
process.destroy(); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
83 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
84 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
85 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
86 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
87 |
public static void launch(String expectedMessage, String... toolArgs) |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
88 |
throws IOException { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
89 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
90 |
launch(expectedMessage, Arrays.asList(toolArgs)); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
91 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
92 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
93 |
public static void printStackTraces(String file) throws IOException { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
94 |
try { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
95 |
String output = HprofReader.getStack(file, 0); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
96 |
if (!output.contains("JShellToolProvider")) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
97 |
throw new RuntimeException("'JShellToolProvider' missing from stdout/stderr"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
98 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
99 |
} catch (Exception ex) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
100 |
throw new RuntimeException("Test ERROR " + ex, ex); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
101 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
102 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
103 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
104 |
public static void testHeapDump() throws IOException { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
105 |
File dump = new File("jhsdb.jmap.heap." + |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
106 |
System.currentTimeMillis() + ".hprof"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
107 |
if (dump.exists()) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
108 |
dump.delete(); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
109 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
110 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
111 |
launch("heap written to", "jmap", |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
112 |
"--binaryheap", "--dumpfile=" + dump.getAbsolutePath()); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
113 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
114 |
assertTrue(dump.exists() && dump.isFile(), |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
115 |
"Could not create dump file " + dump.getAbsolutePath()); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
116 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
117 |
printStackTraces(dump.getAbsolutePath()); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
118 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
119 |
dump.delete(); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
120 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
121 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
122 |
public static void launchJshell() throws IOException { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
123 |
System.out.println("Starting Jshell"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
124 |
String jdkPath = System.getProperty("test.jdk"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
125 |
if (jdkPath == null) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
126 |
// we are not under jtreg, try env |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
127 |
Map<String, String> env = System.getenv(); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
128 |
jdkPath = env.get("TESTJAVA"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
129 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
130 |
if (jdkPath == null) { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
131 |
throw new RuntimeException("Can't determine jdk path neither test.jdk property no TESTJAVA env are set"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
132 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
133 |
String osname = System.getProperty("os.name"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
134 |
String jshell = jdkPath + ((osname.startsWith("window")) ? "/bin/jshell.exe" : "/bin/jshell"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
135 |
process = Runtime.getRuntime().exec(jshell); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
136 |
pid = process.pid(); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
137 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
138 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
139 |
public static void main(String[] args) throws Exception { |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
140 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
141 |
testHeapDump(); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
142 |
|
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
143 |
// The test throws RuntimeException on error. |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
144 |
// IOException is thrown if Jshell can't start because of some bad |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
145 |
// environment condition |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
146 |
System.out.println("Test PASSED"); |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
147 |
} |
f60890de1dfb
8225715: jhsdb jmap fails to write binary heap dump of a jshell process
fmatte
parents:
diff
changeset
|
148 |
} |