06 June 2018

JMC + JFR

- jmc comes with JDK 1.7.0_u40+, but it discontinued on JDK9. (and now OpenJDK 11 has it).
- jfr profiler, can save events in a fixed period.
- jmc is open source now: https://github.com/JDKMissionControl/jmc
- right button to save (very intuitive)
- enable: -XX:+UnlockCommercialFeatures -XX:+FlightRecorder  (if you are using JDK8_40+, you can dynamically enable JFR.

You can use the following flags to improve accuracy.
-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints

-XX:StartFlightRecording=delay=10s,duration=90s,name=Test,filename=recording.jfr,settings=profile

$ java -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=delay=10s,duration=90s,name=Test,filename=recording-test.jfr,settings=profile -jar target/hola-0.0.1.jar

-XX:FlightRecorderOptions=loglevel=info


JMC = Java Mission Control
JFR = Java Flight Recorder

No comments :

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.