try (Recording r = new Recording()) {
r.setToDisk(false);
r.start();
r.stop()
r.dump(Path.of("recording.jfr"));;
}
results in:
Exception in thread "main" java.io.IOException: Unexpected error during I/O operation
at jdk.jfr.internal.WriteableUserPath.doPrivilegedIO(WriteableUserPath.java:139)
at jdk.jfr.internal.PlatformRecording.dumpStopped(PlatformRecording.java:714)
at jdk.jfr.internal.PlatformRecording.dump(PlatformRecording.java:707)
at jdk.jfr.Recording.dump(Recording.java:388)
at Name.main(Name.java:16)
Problem is that JFR tries to make a dump file, but there are no chunks in the repository since it's an in memory recording. Documentation should make it clear under what circumstances it's possible to dump a recording. The error message should be changed so user understands why it fails.
r.setToDisk(false);
r.start();
r.stop()
r.dump(Path.of("recording.jfr"));;
}
results in:
Exception in thread "main" java.io.IOException: Unexpected error during I/O operation
at jdk.jfr.internal.WriteableUserPath.doPrivilegedIO(WriteableUserPath.java:139)
at jdk.jfr.internal.PlatformRecording.dumpStopped(PlatformRecording.java:714)
at jdk.jfr.internal.PlatformRecording.dump(PlatformRecording.java:707)
at jdk.jfr.Recording.dump(Recording.java:388)
at Name.main(Name.java:16)
Problem is that JFR tries to make a dump file, but there are no chunks in the repository since it's an in memory recording. Documentation should make it clear under what circumstances it's possible to dump a recording. The error message should be changed so user understands why it fails.
- csr for
-
JDK-8294530 Update specification of jdk.jfr.consumer.Recording::dump(Path) in case of an in memory recording
-
- Closed
-