Last week, while working on the new features for Subtext vNext, I encountered a strange problem that never happened to me before. I was running the latest "works here" Nightly Build of ReSharper 4 (build num 767) and started getting tons of OutOfMemoryException.

The problem started to happen when, after developing all the DataAccess and BusinessLogic with a TDD approach (so no UI involved), I started adding textboxes and method calls in aspx pages. So I guess the problem has something to do with handling aspx files and all the added complexity that a simple class file doesn't have.

It seems to be quite a old issue, since it was reported in 2006 on ReSharper 2.

Today, while browsing R# wiki I found a page that contains a fix for this problem:

OutOfMemory exceptions are often caused by address space fragmentation in Visual Studio process. For users experiencing excessive OutOfMemory exceptions we provide a tool which overrides Visual Studio's memory allocation policy to ensure more continuous address space for Common Language Runtime.

To use the tool download wrappers.zip file, unpack it and run devenv2005_wrap and devenv2008_wrap instead of devenv.exe for Visual Studio 2005 and 2008 correspondingly.

I just downloaded the wrapper, together with the latest nightly build "works here" (build num 775) and for the moment didn't have the exception yet.