- Running the profiler
- Profiler activation
- Running applications with the profiler
- Connect to profiled application
- Troubleshoot connection problems
- Solving performance problems
- CPU profiling
- Deadlock detector
- Memory profiling
- Garbage collection
- Monitor profiling
- Exception profiling
- Probes: monitor events of various kinds
- Performance Charts
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Summary, snapshot annotation, automatic deobfuscation
- IDE integration
- Time measurement (CPU time, wall time)
- Snapshot directory customization
- Export of profiling results to HTML, CSV, XML, plain text
- Profiler API
- Command line tool to control profiling
- FAQ: How to profile in my scenario?
To enable integration, you should install the profiler plugin.
To install the plugin, run the profiler.
Use Profile from within IDE... action on Welcome screen or in "Tools" menu, select "IntelliJ IDEA" and follow the instructions.
Profiling from IDEA
After the plugin is installed, the Profile actions are added to the main toolbar ...
... to the main menu ...
... and to context popup menus:
To configure the profiler parameters:
- Open the Run/Debug Configurations dialog.
- Select the run configuration.
IntelliJ IDEA 2020.3 and newer: Click the link Modify options and select the item Profile in the Startup/Connection section of the drop down list.
IntelliJ IDEA 2020.2 and older: Select the Startup/Connection tab.
The Profile action starts the profiled application, and connects to it in profiler UI (unless opposite behavior is configured). The output of the profiled application appears in console, same as for Run action.
32-bit or 64-bit JRE selection
This topic is not applicable to macOS where the profiler agent a universal binary.
On a 64-bit machine, the Profile action must know whether the JVM for launching the profiled application is 32-bit or 64-bit, in order to supply appropriate profiler agent version.
By default, the plugin attempts to automatically detect the JVM kind by obtaining available information from IDEA.
For particular run configurations this may happen that the automatic detection is not possible.
In this case Profile will fail with an error like
Error occurred during initialization of VM. Could not find agent library
printed in the IDEA console.
In this case use the "32-bit or 64-bit JRE Selection" section to specify Java bitness explicitly.
While profiling, you usually need to browse the related source code to understand the performance problems at hands. After the problem is located, you edit the source code to fix it.
Use Tools | Open in IDE (F7) to open the underlying source code in the editor of your IDE - the best place to browse and edit code.
The navigation action works on the current selection and is available in both CPU and memory views. Take note of the extremely useful ability to locate the code of anonymous classes and their methods, which is a very difficult thing to do manually.