Rider Profiling Instructions (Java process)
NB! This article covers only Java Rider process (JetBrains Rider). For .NET process (JetBrains Rider.Backend) related issues refer to this article.
IDE hangs and doesn't respond
Please collect TreadDumps from Rider logs folder for reporting the problems when IDE is completely frozen and doesn't respond to any actions for a long time. A dump should be taken exactly at the moment when IDE doesn't respond and record the thread stack.
If you can continue working with the IDE, but it feels slower than expected, CPU usage is high or there is a memory leak, read below.
The CPU usage is high or IDE is slow
If you can continue working with the IDE, but it feels slower than expected or CPU usage is high read below.
2019.2 and above
Details
Capture CPU Snapshot
To provide an informative CPU snapshot you should click on Help | Diagnostic Tools | Start CPU Usage Profiling. You may be prompted to restart the IDE the first time you use this action (to add the necessary VM options). In this case, select Start CPU Usage Profiling again after the restart.
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 Help | Diagnostic 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.
2019.1 and earlier
Details
- Capture CPU usage snapshot of slow startup
- Enabling Profiler Agent
- Capturing Snapshots
- Upload snapshot
Enabling Profiler Agent
WINDOWS/MAC/LINUX
Profiler agent is enabled by default in EAP builds, to enable it in the release builds do the following:
- Help | Edit Custom VM Options
- At the end of the .vmoptions file add the following line:
Mac:
-agentlib:yjpagent=delay=10000,probe_disable=*
Windows/Linux:
-agentlib:yjpagent64=delay=10000,probe_disable=*
Linux with 2017.3 or lower product version
-agentlib:yjpagent-linux64=delay=10000,probe_disable=*
Capturing Snapshots
After restarting the IDE you should see two new items under the Tools menu: Start CPU Usage Profiling and Capture Memory Snapshot.
CPU 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
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:
-Dprofile.trace=true
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.
MEMORY SNAPSHOT
If the problem you are reporting is related to the heavy memory usage and frequent garbage collection, use the Capture Memory Snapshot menu item. To capture automatic memory snapshots when IDE runs out of memory, add
-XX:+HeapDumpOnOutOfMemoryError
into .vmoptions file. A dump file (.hprof) will be created in the current working directory of the application (<Rider Installation Folder>/bin). In case this directory is read-only, add
-XX:HeapDumpPath=/dumps/folder
option to change it. See Oracle documentation for more details.
Please note, that memory snapshot may contain the sensitive source code from your project.
Profiling Slow Startup
If IDE is starting up slow please read below.
2019.2 and above
Details
Capture CPU usage snapshot of slow startup
Invoke Help | Diagnostic Tools | Profile Slow Startup and Restart the IDE. After the restart, invoke Help | Diagnostic Tools | Stop CPU Usage Profiling.
2019.1 and earlier
Details
Capture CPU usage snapshot of slow startup
To profile slow startup by automatically enabling CPU snapshot recording right after IDE is started, please use the sampling option:
-agentlib:yjpagent64=sampling
Adjust this line depending on the OS and the JDK (32-bit/64-bit, see in Help | About). Please check the Enabling Profiler Agent section above. You just need to replace delay=10000 option with the sampling option and make sure NOT to specify the probe_disable=* option.
CPU snapshot file will be saved automatically after your close the IDE into your HOME/snapshots directory with the .snapshot extension.
Memory Leak or High Memory Consumption
If you can continue working with the IDE, but there is a memory leak, read below.
Details
Memory Snapshot
If the problem you are reporting is related to the heavy memory usage and frequent garbage collection, while increasing the heap size doesn't help, use the Help | Diagnostic Tools | Capture Memory Snapshot (2019.2 and above) or Tools | Capture Memory Snapshot (2019.1 and earlier) menu item. To capture automatic memory snapshots when IDE runs out of memory, add
-XX:+HeapDumpOnOutOfMemoryError
into .vmoptions file. .hprof dump file will be created in the current working directory of the application (RIDER_HOME/bin). In case this directory is read-only, add
-XX:HeapDumpPath=/dumps/folder
option to change it. See Oracle documentation for more details.
Please, note that memory snapshot may contain the sensitive source code from your project.
Profiling Slow Indexing
The action is available in 2019.2+. If indexing became slower or indexing can't finish, read below.
Capture CPU snapshot of slow indexing
Invoke Help | Diagnostic Tools | Profile Indexing. Click Invalidate and Restart (please note that Local History and Indices will be destroyed). Click Open Snapshot in ... to locate the snapshot.
If indexing doesn't stop, invoke Help | Diagnostic Tools | Stop CPU Usage Profiling after waiting on the indexing phase a bit.
Uploading Snapshots to JetBrains Upload Service
If your snapshot is smaller than 10MB, it's fine to attach directly to support tickets or YouTrack issues. Otherwise, please use the JetBrains Upload Service.
After you've saved the snapshot, please upload it to our Upload Service and share the Upload ID in the support ticket or the YouTrack issue.
You can also use other sharing services like Dropbox, Google Drive, etc. and send us the link.
Please see Uploading Large Files for JetBrains Support Team for more details.
Please sign in to leave a comment.