How to write distributions using JFR on the command line?

I have a profile that I created using Java Mission Control, which has distribution profiling. When I used it from the JMC UI for writing, everything works fine, and I get the results.

However, after exporting the settings and trying to write using JFR on the command line, I do not get the selected records, although I get other profiling information.

I start recording with the following settings: JAVA_OPTS="$JAVA_OPTS -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,settings='<path_to_settings>/settings.jfc',dumponexit=true,dumponexitpath=<output>" java -jar stuff

When loading a record in the JMC and checking part of the memory, I see the message Event type 'Allocation in new TLAB' is not enabled in this recording .

The settings file is here: https://gist.github.com/jmiettinen/1976f9bbe156ecb5e232 , and it has the corresponding settings java/object_alloc_in_new_TLAB and java/object_alloc_outside_TLAB .

Am I missing something? I am running 1.8.0_66 and want to have continuous recording from the beginning of the application until it stops.

+5
source share
2 answers

Checked with @jmiettin in Jfokus that these flags do the trick:

These options work for me if you want to have a continuous recording with special settings and force it to unload data when exiting: -XX: FlightRecorderOptions = dumponexit = true, dumponexitpath = rec.jfr -XX: StartFlightRecording = defaultrecording = true, settings = q: /tmp/wop.jfc

The difference is that by default, set the recording options and settings after -XX: the StartFlightRecording flag.

+6
source

What version of JDK are you using?

There is a bug fixed in 7u76 and 8u20, where the settings parameter is not respected if defaultrecording = true.

+1
source

Source: https://habr.com/ru/post/1240938/


All Articles