4

I am trying to profile the run of my Java code using Java Flight Recorder (JFR). To do this, I am using the terminal command:

java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=500s,filename=myrecording.jfr -jar runnableJARFile.jar

This runs my program & seemingly creates the .jfr recording file, however when I try to open it in Java Mission Control, I get the error:

'Loading events from myrecording.jfr' has encountered a problem.

The file format of myrecording.jfr is not supported. Try with a more recent version of Mission Control.

However, I have checked and I am running JMC 6.0.0 (which appears to be the latest) version, as well as JDK 11.0.0 (also seems to be the latest version). When I check for updates, both show to be up to date.

Any ideas how to get the JFR file to open in JMC?

NOTE: I am using Eclipse as an IDE, however can't seem to get the flight recording to start simultaneously with the program; this is why I am using terminal. (Running OS X El Capitan)

Chynna
  • 55
  • 8

1 Answers1

3

Try the early access build of JMC 7 (which is now open source). That is what’s designed to work with JDK 11 (and earlier) https://jdk.java.net/jmc/

(JMC is generally backwards compatible)

Klara
  • 2,935
  • 22
  • 19