Wednesday 23 April 2008

System.OutOfMemoryException during Visual Studio 2008 build

Just recently, Visual Studio 2008 kept failing with a System.OutOfMemoryException when doing a build. The problem seems to have been due to inadequate Windows virtual memory. I upped the value of the paging file and, so far, have had no further exceptions.

... 1 hour later... whoops, spoke too soon. A re-installation is now taking place.

[Edit 2/5/2008: Still no luck. I have noticed that massive amounts of data are generated in the temporary ASP.NET files folder (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files). The other day, VS created over 3Gb of data in there when building a solution that was only 187Mb in size. Might be part of the problem.]

3 comments:

Unknown said...

Hi Neil,
I am facing this problem, too.

Did you find any solution?

Thanks
Kubilay

Neil said...

Hi Kubilay,
Unfortunately not. A colleague sent me a link to a solution I haven't yet tried. I shall need to find it again. I shall then post it here. As an aside, I've noticed the problem seems to occur, or be more frequent, after I've viewed an ASPX or ASCX file in design mode.
Cheers,
Neil

Neil said...

Here's the link I mentioned:

Hacking Visual Studio to Use More Than 2 Gigabytes of Memory