Reputation: 10662
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?
Upvotes: 1
Views: 1530
Reputation: 106
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.
Upvotes: 0
Reputation: 7069
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.
Upvotes: 3