Question

IDE Configuration:

Visual Studio 2008 + Resharper 4.5.1 + Agent Smith 1.1.8. There is no any sophisticated configuration for last to add-ins.

Solution description:

33 class libraries + web site with 200+ pages.

Symptoms: After an hour of work under tuned on Resharper the IDE starts to throw the OutOfMemoryExection exceptions. Normal work is impossible only reopen Visual Studio can help.

Does anybody has such problem? Is it possible to configure Resharper to consume less memory? What Resharper feature does consume the most memory?

Was it helpful?

Solution

If you're on 64-bit Windows (or you're happy to run 32-bit Windows with the /3GB switch), then you can configure Visual Studio to be /LARGEADDRESSAWARE, which, rather than 2GB, will give it 4GB (or 3GB on /3GB) of address space to play with.

See, for example, http://old.stevenharman.net/blog/archive/2008/04/29/hacking-visual-studio-to-use-more-than-2gigabytes-of-memory.aspx, which gives the following:

editbin /LARGEADDRESSAWARE devenv.exe

Also, see the JetBrains page on the topic: http://www.jetbrains.net/confluence/display/ReSharper/OutOfMemoryException%2BFix

OTHER TIPS

Welcome to the World of ReSharper. This lesson is called, "You get what you pay for".

Various features of ReSharper do require knowledge of your entire solution. This information takes memory. The solution-wide analysis may be the most memory-intensive, but even changing the signature of a public method requires knowing all the code that calls that method.

One thing you can do sometimes is to use smaller, "sub-solutions". If you are refactoring your DAL layer for instance, you only need the DAL and any unit test projects. What I sometimes do is to select the solution in Solution Explorer and use File->Save Solution As to save it with a different name in the same folder. I then remove projects until I'm left with those I want. Do not save the projects you're removing (save them before you start). When you've got the set you want, just do a Save All.

If it becomes too much of an annoyance, you can also get ReSharper to display the memory usage in the status bar. That feature has been available for a long time.

I have seen this and similar problems in the past with earlier versions of Resharper (and other similar add-ins) and large solutions, and is one of the reasons I try to stay away from them. The only solutions I know of were to restart Visual Studio, uninstall Resharper, or keep it turned off except for when you really need to use it.

For what it's worth, Visual Studio 2010 should help with these types of problems.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top