1. 参数:

-XX:+UnlockCommercialFeatures -XX:+FlightRecorder

2. 运行命令:

jcmd <PID> JFR.start name=test duration=60s settings=template.jfc filename=output.jfr

/usr/java/jdk1.8/bin/jcmd 34 JFR.start name=test duration=60s settings=profile.jfc filename=/tmp/output.jfr

参考:

https://www.cnblogs.com/duanxz/p/8533797.html

https://medium.com/@chrishantha/using-java-flight-recorder-2367c01deacf

04-18 04:29