Visual Studio with ReSharper is high on memory usage

Sometimes, Visual Studio with ReSharper can eat up more RAM than it should. This situation can be caused by several things, and here are some troubleshooting steps to determine the cause of it.

  1. Visual Studio configuration. Sometimes, memory issues can be caused by other extensions, which are installed in Visual Studio with ReSharper. It is a nice idea to temporary turn off or uninstall all other plugins/extensions, reload VS with ReSharper only and check memory usage after that.
  2. ReSharper configuration.
    1. Memory-heavy options. Several ReSharper features are known to use more memory when enabled. The most common feature is Solution Wide Analysis, which can use several hundred megabytes of RAM, especially on a big-sized solutions.
      Try to turn off Solution Wide Analysis (SWA) in "ReSharper | Options | Code Inspection | Settings", 'Analyze errors in whole solution' checkbox.
    2. Monitoring Visual Studio Managed Memory. To enable this, please turn on the 'Show managed memory usage in status bar' checkbox located in "ReSharper | Options | Environment | General" dialog. This will indicate amount of managed memory used by VS.
      Please note, that you need to have the VS Status Bar visible to see the indication ("Tools | Options | Environment | General | Show status bar" checkbox).

    3. Manual Garbage Collection. Sometimes, CLR is not able to collect garbage automatically, and you can force a manual garbage collection. To do that, enable the 'Show managed memory usage in status bar' checkbox and described above and either double click on it, or right click and select the corresponding action.

  3. Verifying that the issues are caused by ReSharper. To do that, simply suspend ReSharper as described here and check if memory issues are still present.
  4. Perform a Memory Profiling. If none of the above helps, it is necessary to profile Visual Studio (with ReSharper enabled) process for memory usage. To do that, follow the instructions described here. After that, please create an issue in our YouTrack and let us know a short description of the memory consumption problems you're experiencing, and specify the name of your snapshot.

 

5 out of 34 found this helpful
15 comments
Avatar
Martin Sedlmair

I'm also having extreme problems with my VS2015+Resharper. I have 32GB of memory and sometimes nothing is left. Even if I close VS2015 the memory is not available again. Looking in the process manager I can also not see how consumes this large amount of memory. Do you know a way to find out who is using the memory?

 

Suspending Resharper also didn't help. 1GB was freed but not more.

2

ReSharper is using 1.15 GB of memory, according to the toolbar.  If VS were 64-bit, this would be a non-issue, but the IDE goes non-responsive while debugging (presumably because of memory fragmentation).  I'm disabling solution-wide analysis to see if that helps, but I have issues with being told to disable features to make the product usable.  My solution has < 20 projects; not what I'd consider a large solution.

7

Disabling solution-wide analysis does not help; nor does disabling most of my other extensions.  Forcing a garbage collect rarely frees up more than a megabyte or two.  ReSharper has once again become a memory hog, and I'm pretty sick and tired of having to kill devenv.exe because the IDE goes unresponsive when debugging due to being out of memory.

The issue is reminiscent of when JetBrains had a launch wrapper to handle memory management more efficiently... the virtual size is just under 4GB, but the actual physical memory being used is only about 2.5GB - seems like the issue is memory fragmentation more than anything.

4

I fully agree with James, we are really currently thinking of getting rid of Resharper. It causes more trouble than it's good. Since VS2017 has almost all the features we need, there no need to install Resharper anymore - so if nothing changes, we will switch to VS2017 immediately. We had bought 20 new licenses (the whole company has surely 1000) from JetBrains but there's no answer from JetBrains about this issue.

6

Wow, just installed VS 2017. Without ReSharper, my solution consumes around 400mb. With ReSharper enabled, it went to 2GB. I know it used to consume a bit more but in this state, is unusable. 

4

There is a serious memory leak with ReSharper++. Even with trivial C++ projects ReSharper memory usage quickly skyrockets above 2GB with only a moderate amount of time passed. It makes ReSharper completely unusable for any C++ project. In just 3 hours, I had to restart VS2017 12 times... It seems like this issue has been around for quite a long time now, which explains why not many people use ReSharper++. It destroys productivity instead of boosting it and on a somewhat high-end machine with 32GB DDR4 and i7-4790k one would expect much better performance.

1

I also had to uninstall.  was pushing the winforms solutions above 2 gig regularly and crashing vs.net 2017

uninstalled and memory usage rarely gets above 1.3 gig now for my largest solution.

1

It seems to me that JetBrains is taking this issue not serious. I'm awaiting an answer or at least someone from JetBrains that takes care of this issue!

Even with the latest Resharper/VS2017 the issue is still there. I have worked without Resharper more than one year and there were only some irregular and seldom crashes. Now with Resharper installed back again, the problems grow.

Edited by Martin Sedlmair
1

I guess the only way to help the JetBrains team is to go through their memory profiling guideline. This memory issue seems pretty random -- it only happens on my work PC, but never on my home PC, even though the specs are similar. Feels like some internal error log is getting filled with thousands of redundant entries that are never cleaned up. It's a logical reference leak and the GC can't clean it up because there a list full of valid references.

I'll try getting a memory profiling session recorded.

1

The latest version of R# (2018.3.1)  is absolutely awful with Visual Studio 2017 (15.9.6) in terms of memory usage, it has been crashing the IDE constantly for a week now. R# doesn't seem to like solutions with a lot of projects and especially with SQL projects in the solution.

I opened a SQL file and the editor was suddenly completely unusable, so I let it do its thing until it becomes responsive. I saw the memory jump from 1.6 GB to 2.3 GB within a minute and the editor was still unusable.

I initially though it was VS but after running the ReSharper_ToggleSuspended command the memory dropped to 1.4 GB and the editor was instantly available for input. So there is definitely something absolutely wrong with the product.

Please STOP ADDING NEW FEATURES and FIX WHAT'S IN PLACE ALREADY!

0
Avatar
Bruno Lorenz Juchli

I'm using VS2017 15.9.12 with Resharper 2018.3.4.
Visual studio gets extremely slow once devenv.exe hits about 1900MB of Memory (private working set).
I've got 32GBs of ram in my machine and 22GB of them as available.

I know devenv is a 32bits application so isn't able of addressing more than 4GB. But how can I get it to consume more than ~2GB of memory?

Note: Large Adress Aware flag is set on devenv.exe

Edited by Bruno Lorenz Juchli
0
Avatar
Volodymyr Shkolka

Try to clone https://github.com/NuGet/NuGet.Client.git this repository and open main solution %) ReSharper just cannot normally work with this solution because of 'high on memory usage'.

0

Hello.

I have the same issue with Rider. 2020.2.4. Is it any solution?

0

I have the same issue with VS2017 + Resharper 2020.3.1. Is it any solution?

Edited by Andropolon
0

Turning off SWA worked, but it still seems like a bug that only one particular solution made it run out of control.  I was loosing 10 GB over a couple minutes before I had to end task the solution.  Left unchecked the entire OS was starved out and I had to resort to hard reboot a couple times before I determined what was causing the issue.

0

Please sign in to leave a comment.

Have more questions?

Submit a request