Java Flight RecorderUltimate
OS: Linux, macOS, Windows
Configure: Settings/Preferences | Build, Execution, Deployment | Java Profiler
Java Flight Recorder (JFR) is a monitoring tool that collects information about the events (pieces of data) in a particular instant of time in a Java Virtual Machine during the execution of an application.
Java Flight Recorder is supported natively in the following JDK builds:
Oracle JDK 8-10: provided that the
UnlockCommercialFeatures
VM option is enabledOracle JDK 11 and later
OpenJDK 11 and later
Enable JFR for Oracle JDK 8 or later
From the main menu, select Run | Edit Configurations and from the list on the left, select the run configuration that you want to analyze with JFR.
On the Configuration tab, expand the Environment section.
To the VM options field, add the following line:
-XX:+UnlockCommercialFeatures
.warning
The flag unlocks commercial features that are the products Oracle Java SE Advanced or Oracle Java SE Suite. Before enabling them, read Oracle Binary Code License Agreement for the JAVA SE Platform Products carefully.
Apply the changes and close the dialog.

JFR configurations
There are two pre-installed configurations: Default and Profile. The Default configuration has low overhead (about 1%). That's why it works well for continuous profiling. The Profile configuration has overhead about 2% and can be used for more detailed application profiling.
These configurations cover most use cases. You can select the most suitable configuration in Settings/Preferences | Build, Execution, Deployment | Java Profiler | Java Flight Recorder.

If the pre-defined configurations don't meet your needs, you can create and upload your own settings by means of Java Mission Control.