Symptoms
Memory Leak or High Memory Consumption of the JetBrains.Roslyn.Worker process. In the OS activity monitor the process that consumes RAM is named as dotnet (.exe), not as JetBrains.Roslyn.Worker (.exe).
How exact command line for the JetBrains.Roslyn.Worker process?
The executable for the process is dotnet (.exe) and the JetBrains.Roslyn.Worker binary is passed as an argument. There is how it launches depending on OS:
Windows:
{RiderInstallPath}\lib\ReSharperHost\windows-x64\dotnet\dotnet.exe "{RiderInstallDir}\lib\ReSharperHost\windows-x64\dotnet\dotnet.exe" exec --runtimeconfig "{RiderInstallPath}\lib\ReSharperHost\JetBrains.Roslyn.Worker.windows.runtimeconfig.json" "{RiderInstallPath}\lib\ReSharperHost\JetBrains.Roslyn.Worker.exe" {portNumber} {PID}
MacOs:
{RiderInstallPath}.app/Contents/lib/ReSharperHost/macos-arm64/dotnet/dotnet {RiderInstallPath}.app/Contents/lib/ReSharperHost/JetBrains.Roslyn.Worker.exe {portNumber} {PID}
Linux:
{RiderInstallPath}/lib/ReSharperHost/linux-x64/dotnet/dotnet {RiderInstallPath}/lib/ReSharperHost/JetBrains.Roslyn.Worker.exe {portNumber} {PID}
Question
How to collect a memory snapshot to investigate a particular memory leak or high memory consumption of the JetBrains.Roslyn.Worker process?
Answer
When the problematic process is dotnet */JetBrains.Roslyn.Worker, there is a chance the memory leak is caused by the analyzer itself. Should you wish to investigate the issue yourself, see How to investigate high memory usage of a custom Roslyn Analyzer in Rider. If still the cause isn't clear, please share a couple of memory snapshots with the JetBrains team. Depending on your current state, follow the corresponding instruction:
I can easily reproduce the issue from Rider start:
- Open a problematic project;
- After all the background tasks are finished, select Help | Diagnostic Tools | Profile Rider Internal .NET Process
- Select Profiling Type to "Memory" and process to "Roslyn Worker (PID)". Then select OK.
- Work as usual, so that the RAM consumption of the
dotnet */JetBrains.Roslyn.Workergoes high to unacceptable values; - Once the issue is reproduced, repeat the steps 2-3;
The issue is happening at the moment, let’s just capture snapshots:
- Select Help | Diagnostic Tools | Profile Rider Internal .NET Process
- Select Profiling Type to "Memory" and process to "Roslyn Worker (PID)". Then select OK.
- Wait for the snapshot to dump into
{USER_DIR}/RiderSnapshots; - In Rider invoke the "Restart Roslyn Analyzers and Source Generators" action via Shift+Shift:
- Wait for ~10 seconds, repeat the steps 2-3 so that another snapshot generates;
Last steps:
- Find the generated snapshots in
{USER_DIR}/RiderSnapshots; - Share these two generated snapshots upon request or report a separate issue (if you didn't yet contact us regarding your issue, or explicitly requested to report another issue).
If dumps are too heavy to attach directly directly to your request, upload it to the JetBrains Uploads Service and mention the Upload ID where you were requested for a memory snapshot.
Comments
0 comments
Please sign in to leave a comment.