Profiling ReSharper using built-in or standalone profilers
Performance Issues
RESHARPER BUILT-IN PROFILER
In order to get a performance snapshot for ReSharper using an embedded profiler, follow these steps: https://resharper-support.jetbrains.com/hc/en-us/articles/207243205
STANDALONE DOTTRACE PROFILER
In order to get a performance snapshot for ReSharper using dotTrace follow these steps:
-
Download and install dotTrace Performance profiler from https://www.jetbrains.com/ | Select 64-bit version
-
Start dotTrace. The dotTrace Home window will open.
-
Under Choose what you want to profile, New Process Run, click Add.
-
In the New Run Configuration wizard, choose Standalone and click Next.
-
Specify a path to the Visual Studio executable (devenv.exe).
-
Click Save.
-
Make sure the following options are set in Profiler Options:
- Profiling type: Sampling (or Tracing or Timeline if you have been asked to collect exactly Tracing/Timeline snapshot).
- Collect profiling data from start: on (if you're experiencing performance problems on Visual Studio startup or during solution loading) or off otherwise.
-
Click Start.
-
If there's a performance problem during startup:
- Wait while Visual Studio starts, open your solution;
- Wait until the solution is loaded and ReSharper finishes loading caches;
- Click Get Snapshot button in the profiling controller window.
-
Otherwise:
- Wait while Visual Studio starts, open your solution;
- Click Start recording (Start) button in the profiling controller window;
- Perform actions which are slow with ReSharper (typing, switching between documents, building etc);
- Click Get Snapshot button in the profiling controller window.
-
In dotTrace Performance Viewer, save the resulting snapshot using the File | Save Snapshot... menu.
-
Compress the snapshot file using Zip.
-
Upload the file to https://uploads.services.jetbrains.com/.
-
Create a new issue in ReSharper issue tracker. In the issue, provide a short description of the performance problems you're experiencing and specify the name of your snapshot.
USE DOTTRACE COMMAND-LINE PROFILER
-
Download the tool from here.
-
Steps that describe what steps you need to take to collect a snapshot are here.
-
Upload the file to https://uploads.services.jetbrains.com/.
-
Create a new issue in ReSharper issue tracker. In the issue, provide a short description of the performance problems you're experiencing and specify the name of your snapshot.
Memory Issues
RESHARPER BUILT-IN MEMORY PROFILER
In order to get a memory snapshot for ReSharper using embedded profiler follow these steps (full manual is here):
- Go to 'ReSharper | Help | Report bug or submit feedback'.
- Choose 'Problem Report | Problem category: Performance problem'.
- Hit "green cross" icon next to "Attachments" text | select "Memory Snapshot" | It will start self-profiling tool.
- Note: on a 1st run self-profiling tool will be downloaded from JetBrains server, download times may vary so please be patient.
- After profiling is complete, you'll be able to upload the snapshot to our FTP server by clicking on Submit button
STANDALONE DOTMEMORY PROFILER
In case of memory issues with ReSharper, please follow the instructions below.
-
Download and install the trial version of dotMemory.
-
Run dotMemory. The dotMemory Home window will open.
-
Under Choose what you want to profile, New Process Run, click Add.
-
In the New Run Configuration wizard, choose Standalone and click Next.
-
Specify a path to the Visual Studio executable (devenv.exe). For example: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe
-
Click Save.
-
Click Start. This will run Visual Studio.
-
Open your solution and wait until it is completely loaded.
-
Collect a memory snapshot by clicking Get Snapshot in dotMemory.
-
In Visual Studio, perform actions that are suspected to cause memory issues (high memory traffic, exceptions, etc.).
-
Collect a snapshot one more time by clicking Get Snapshot in dotMemory.
-
Close Visual Studio.
-
In dotMemory on the Home page, on the left panel, choose Workspaces.
-
In the list of workspaces, right-click the desired workspace and, in the context menu, select Export.
-
Select a folder where you want a workspace file to be saved and click OK.
-
Upload the file to https://uploads.services.jetbrains.com/.
-
Create a new issue in our issue tracker.
In the issue, please provide:- A short description of the issue.
- Steps required to reproduce the issue.
- The name of the uploaded file.
USE DOTMEMORY COMMAND-LINE PROFILER
-
Download the tool from here.
-
Steps that describe what steps you need to take to collect a snapshot are here.
-
Upload the file to https://uploads.services.jetbrains.com/.
-
Create a new issue in ReSharper issue tracker. In the issue, provide a short description of the performance problems you're experiencing and specify the name of your snapshot.
.NET MEMORY PROFILER
Prepare environment:
-
Before starting Visual Studio:
- Open devenv.exe.config in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE"
- In the <runtime> section add <gcConcurrent enabled="false"/>
-
Download NmpCore.exe (or you can try newer version from the vendor site)
-
Enable Managed Memory Indicator in ReSharper | Options | Environment | General
Get snapshot:
-
Get process ID for devenv.exe process in question
-
Double-click managed memory indicator in Visual Studio status bar (to the right) to perform Garbage Collection
-
Execute the following command, substituting <pid> and path to snapshot:
NmpCore.exe /a <pid> /cs1 /sf "full-path-to-snapshot-file.prfsession"
C detected
Advanced snapshots:
- Download evaluation version of .Net Memory Profiler
- Install and start it
- Open Tools / Options, select "Call Stacks" page and uncheck "Enable stack reducer" on General tab
- Click "Profle application" on the main screen
- Enter path to Visual Studio executable "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" and click Next
- Select "Custom" profiling level, and click Next
- Select "Full" on instance tracking page, and click Next
- Select "Yes" for the collect allocation call stacks choice, and click Next
- Select "No" for dispose tracker, real-time data collection, heap utilization, AppDomain tracker, unmanaged resources tracker and instance data trackers.
- Click Start to start process and begin profiling
- Open your solution and after everything settles down, click Collect Snapshot in profiler to create base-line snapshot
- Perform actions that are producing memory traffic, or cause excess memory allocations
- Collect snapshot
- Hit "Stop profiling" button and save snapshots in a .prfsession file
Upload snapshot and create an issue:
- Compress the resulting snapshot using Zip
- Upload it to https://uploads.services.jetbrains.com/.
- Create a new issue in ReSharper issue tracker. In the issue, provide a short description of the memory consumption problems you're experiencing, and specify the name of your snapshot.
Please sign in to leave a comment.