Java Flight Recorder - Live Objects Tab is empty

Viewed 300

I am running JDK 1.8_291 and JDK Mission Control 8.0.0.

I am trying to activate Live Objects tab in Flight Recording, Live Objects tab is always empty

I have followed older threads discussing the same problem like:

  1. Java Flight Recorder - no Live Objects
  2. How to enable Object Types + Allocation Stack Traces + Path to GC Root in Java Mission Control

These are the commands I am using :

-ea -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=0s,filename=myrecording.jfr,settings=/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/jre/lib/jfr/profile4.jfc,path-to-gc-roots=true,dumponexit=true

The problem is that I get an error saying "path-to-gc-roots" is an unknown argument.

java.lang.IllegalArgumentException: Unknown argument 'path-to-gc-roots' in diagnostic command.Error occurred during initialization of VM

And this is the settings file I am using: https://pastebin.com/rH5vuVvS

I have noticed that the official documentation of JFR currently does not contain the argument "path-to-gc-roots". But it was present in an older documentation like this one: https://docs.oracle.com/javacomponents/jmc-5-5/jfr-command-reference/JFRCR.pdf

I am asking if there is an alternative way to activate Live Objects tab as this way might be deprecated.

1 Answers

The Old Object Sample event, which can be configured by path-to-gc-roots is not available in Oracle JDK 8. It was introduced in Oracle JDK 10, which is what the referenced pdf-file covers.

There exists two Object Count events, since Oracle JDK 7u40, that traverses the whole heap and count the number of objects per class, no sampling. It's not visualized in the JMC 8 'Live Object' page, but available in JMC 5.5, in the tab called 'Object Statistics'

enter image description here

Related