- Enable Profiler Agent
- Capture CPU usage snapshot
- Upload snapshot
Enabling Profiler Agent
With the Performance Testing plug-in enabled use Help | Diagnostic | Enable CPU Profiler (supported only for IntelliJ IDEA and PhpStorm at the moment, for the other products please read below how to add the proper VM option to enable profiling).
For the older, not yet supported IDE versions or to enable the profiling agent at the IDE start please follow these steps:
- Help | Edit Custom VM Options or locate the .vmoptions file for your product
- At the end of the .vmoptions file add the following line (any macOS and 32-bit Windows/Linux):
Windows/Linux users running under 64-bit JVM and editing <product>64.vmoptions file should use this line instead:
Linux with 2017.3 or lower product version
Please use the following parameter for 64-bit Linux system
or this one for 32-bit Linux:
IntelliJ IDEA and PyCharm Community Editions do not include a YourKit profiler agent, because the YourKit agent library is not open-source. To take a CPU or memory snapshot with the Community Edition, you can download an evaluation version of YourKit Java Profiler, copy the yjpagent library to the IDE bin directory, add it to the .vmoptions as described above, and connect to the running IDE instance from the standalone YourKit Profiler UI.
After restarting the IDE you should see two new items under the Tools menu: Start CPU Usage Profiling and Capture Memory Snapshot.
To provide an informative CPU snapshot you should click on Start CPU Usage Profiling and then perform the actions which are causing performance problems, try to reproduce the performance problem several times while the snapshot is being recorded, then click on the Tools | Stop CPU Usage Profiling to save the snapshot file (snapshot is saved in the user home directory and IDE will show a notification with the exact file name, the extension of the file is .zip). If you don't see a notification and can't find the snapshot file, please check that notifications are enabled for the Profiler.
When reporting the problem, please make sure to describe what you were doing in detail.
CPU Snapshot with Invocation Counts
Since 2018.3 IDE version please hold Shift while clicking on the Start CPU Usage Profiling menu item when asked to provide the snapshot with invocation counts (please do not provide the snapshot with the invocation counts if you were not explicitly asked to do so).
For IDE versions before 2018.3:
When asked to provide a snapshot with the invocation counts, in addition to the -agentlib... option please also add the following into the .vmoptions file:
Make sure there is no disabletracing option in the -agentlib... line, use the options string from the Enabling Profiling Agent section of this document.
Restart your IDE and capture the CPU snapshot from the Tools menu or using the toolbar button.
- Capture Async Profiler Snapshot
- Upload snapshot
Capture Async Profiler Snapshot
Warning: Async Profiler isn't bundled with Community Edition (IntelliJ IDEA or PyCharm) yet, so if you're using it, please see the next section 2019.2 and above instead.
Also, this method is currently available on macOS and Linux only (Windows support is work-in-progress).
1. Select Help | Diagnostic Tools | Start Async Profiler and click Start in a dialog that appears:
2. Perform the actions which are causing performance problems, try to reproduce the performance problem several times while the snapshot is being recorded
3. Then select Help | Diagnostic Tools | Stop Async Profiler and click Stop in a dialog that appears:
4. Open "Event Log" tool window and click "Show Profile" in the last message:
5. File explorer will open. Please put all the opened files in archive and send it to us (see Upload snapshot section)
When reporting, please describe what you were doing while capturing the snapshot.