JFR Settings Files
Table of Contents
Use Java Flight Recorder (JFR) setting files (.jfc) to specify the event and control configuration. Check the JFR Command Line Options to understand how such a setting file can be used.
For instance, to change the settings file for a running recording:
jcmd <PID> JFR.config settings=my-config.jfc
Provided Settings Files
By default, Flight Recorder uses the settings defined in <java_home>/lib/jfr/default.jfc which gives a good balance between data and performance. In the same directory, you can find a second configuration profile.jfc which records more events and is useful while profiling an application.
You can also create a copy of one these files and create your own configuration, e.g. my-config.jfc.
Generating a Custom Settings File
As of JDK 19, it’s strongly encouraged to use the jfr configure utility to create a custom settings file.
$ jfr configure --interactive
============== .jfc Configuration Wizard ============
This wizard will generate a JFR configuration file by
asking 12 questions. Press ENTER to use the default
value, or type Q to abort the wizard.
Garbage Collector: Normal (default)
1. Off
2. Normal
3. Detailed
4. High, incl. TLABs/PLABs (may cause many events)
5. All, incl. Heap Statistics (may cause long GCs)
...