首页  

JFR实战     所属分类 java 浏览量 993
JFR Java Flight Recorder
JMC Java mission control

低开销性能数据收集 ,可用于生产环境中分析Java应用和JVM运行状况及性能问题

ps aux|grep GCTestMain

jcmd 41451 VM.check_commercial_features

jcmd 41451 VM.check_commercial_features
41451:
Commercial Features are locked.

jcmd 41451 VM.unlock_commercial_features 
41451:
Commercial Features now unlocked.


jcmd 41451 VM.check_commercial_features
41451:
Commercial Features are unlocked.
Status of individual features:
  Java Flight Recorder has not been used.
  Resource Management is disabled.
  Current Memory Restriction: None (0)
  
加jvm参数
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder 
可不加参数 ,可用jcmd 动态解锁


jcmd 41800 VM.check_commercial_features
jcmd 41800 JFR.start name=jfr001  delay=20s duration=2m filename=/Users/dugang/tmp/jfr/jfr001.jfr
jcmd 41800 JFR.stop name=jfr001

开启录制会显示 
Java Flight Recorder has been used.


jcmd 41800 VM.check_commercial_features
41800:
Commercial Features are unlocked.
Status of individual features:
  Java Flight Recorder has been used.
  Resource Management is disabled.
  Current Memory Restriction: None (0)
  
  
jcmd 41800 JFR.stop name=jfr001
41800:
Could not find recording "jfr001".
Use JFR.check without options to see list of all available recordings.

jcmd 41800 JFR.check

jcmd 41800 JFR.check
41800:
No available recordings.
Use JFR.start to start a recording.

jcmd 41800 JFR.check
41800:
Recording: recording=2 name="jfr002" duration=5m filename="/Users/dugang/tmp/jfr/jfr002.jfr" compress=false (unstarted)

jcmd 41800 JFR.check
41800:
Recording: recording=2 name="jfr002" duration=5m filename="/Users/dugang/tmp/jfr/jfr002.jfr" compress=false (running)

使用jmc打开 jfr文件




java性能分析 JFR 和 JMC JVM性能分析利器 JMC 和 JFR jvm参数查看 jdk jcmd 使用

上一篇     下一篇
日志框架关键组件

Log4j2 lookup 安全漏洞

nginx常用优化

log4j2使用要点

JNDI demo

logback简介