简体   繁体   中英

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?

在此处输入图像描述

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.

To make use of that page you'll need a JFR recording that contains the "Old Object Sample" method and is dumped with the "Path to GC Roots" option enabled. This is due to the reference chains displayed by that page need to be generated in a global safepoint operation, so they're only gathered when needed (and usually with a short timelimit).

More information about this can be found here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM