Question
How to collect Rider Java performance snapshot to investigate a particular performance problem?
Answer
Frontend thread dump:
(when IDE is totally unresponsive to user actions)
Collect a thread dump using jstack utility if Rider does not respond to any actions for a long period of time:
- Find the Process ID (
PID) of the "JetBrains Rider" process - Open
{ide_installation_path}/jbr/binin a terminal - Invoke
.\jstack -l {PID} > dump.txt - Attach the generated
dump.txtto your issue or support ticket
A dump should be taken exactly at the moment when the IDE is not responsive.
Frontend performance snapshot:
(when the CPU usage is high or the IDE is slow)
If you can continue working with the IDE, but it feels slower than expected, or CPU usage is consistently high, collect a performance snapshot:
- Use Help | Diagnostic Tools | Start CPU Usage Profiling to start recording a snapshot. 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.
- Perform actions which are causing performance problems, try to reproduce the performance problem several times while the snapshot is being recorded.
- Use Help | Diagnostic Tools | Stop CPU Usage Profiling to save the snapshot file. The snapshot will be saved in the user home directory, and Rider will show a notification with the exact file name. If you don't see a notification, ensure that notifications are enabled for the Profiler:
- Upload the snapshot via the Upload Service and mention the Upload ID in your issue or support ticket
When reporting the problem, please make sure to describe what you were doing in detail.
Frontend memory snapshot:
(Memory Leak or High Memory Consumption)
If the problem you are reporting is related to the heavy memory usage and increasing the heap size doesn't help, you need to collect a memory snapshot.
If Rider uses a lot of RAM but does not crash
- Enable Memory indicator by right-clicking the status bar and selecting Memory Indicator.
- Reproduce the issue
- Verify that Rider uses a lot of memory according to the memory indicator
- Use Help | Diagnostic Tools | Capture Memory Snapshot
If Rider uses a lot of RAM and crashes with an "Out of memory" error
- Add the following line into .vmoptions file
-XX:+HeapDumpOnOutOfMemoryError
- Reproduce the issue
- The dump file will be created in the current working directory of Rider. In case this directory is read-only, set
HeapDumpPathto change it to an arbitrary path
-XX:HeapDumpPath=/path/to/dump
Once you collect a snapshot, upload the snapshot via the Upload Service and mention the Upload ID in your issue or support ticket.
Please note that a memory snapshot may contain the sensitive information including parts of a source code from your project.
Profiling Slow Indexing
If indexing in Rider is slow or never finishes:
- Invoke Help | Diagnostic Tools | Profile Indexing
- Use Invalidate and Restart to discard existing Rider caches and Local History
- Wait until Rider finishes reindexing your project. If indexing doesn't stop, invoke Help | Diagnostic Tools | Stop CPU Usage Profiling after waiting for indexing to finish for a few minutes.
- Rider will show the "Snapshot was captured" dialog when profiling is complete. Use Open Snapshot in <file manager> to locate the snapshot
- Upload the snapshot via the Upload Service and mention the Upload ID in your issue or support ticket
Comments
0 comments
Please sign in to leave a comment.