< prev index next >
test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -59,21 +59,23 @@
Unsafe.getUnsafe().putInt(0L, 0);
}
}
public static void main(String[] args) throws Exception {
- processOutput(runProcess());
+ processOutput(runProcess(true));
+ processOutput(runProcess(false));
}
- private static OutputAnalyzer runProcess() throws Exception {
+ private static OutputAnalyzer runProcess(boolean diskRepo) throws Exception {
+ String flightRecordingOptions = "dumponexit=true,disk=" + Boolean.toString(diskRepo);
return new OutputAnalyzer(
ProcessTools.createJavaProcessBuilder(true,
"-Xmx64m",
"-Xint",
"-XX:-CreateCoredumpOnCrash",
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
- "-XX:StartFlightRecording=dumponexit=true",
+ "-XX:StartFlightRecording=" + flightRecordingOptions,
Crasher.class.getName()).start());
}
private static void processOutput(OutputAnalyzer output) throws Exception {
output.shouldContain("CreateCoredumpOnCrash turned off, no core file dumped");
< prev index next >