Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

profiling - Java Flight Recorder - no Live Objects

I'm running JFR on JDK 1.8_261.

I'm running my application using those VM options:

-XX:+UseG1GC -XX:+UnlockCommercialFeatures -XX:+FlightRecorder
-XX:FlightRecorderOptions=maxage=5h,defaultrecording=true,loglevel=info,dumponexit=true,
settings=/usr/java/jdk1.8.0_261-amd64/jre/lib/jfr/profile.jfc,dumponexitpath=/tmp/a.jfr

This is the profile.jfc file I'm using: https://gist.github.com/oripwk/e7d598f90e567a658cd767b16379f281

However, I cannot see Live Objects when opening the file with JDK Mission Control as you see in the screenshot.

What do I need to do to enable Live Objects?

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The event for the Live objects (vm/gc/detailed/object_count) is disabled by default due to the overhead, a full sweep of the heap. You can fix this by go to Window -> Template Manager in JMC and check "Heap Statistics" and export the settings file.

Or you can edit the .jfc file manually and set vm/gc/detailed/object_count enabled to true.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...