VS 2010 loading slow - Xap packaging failed. Exception of type 'System.OutOfMemoryException' was thrown

2.4k views Asked by At

I'm having an issue with VS 2010. It's running very slow and also crashes occasionally when compiling and packaging a xap file with the following error:

Xap packaging failed. Exception of type 'System.OutOfMemoryException' was thrown.

In the local Windows 7 temp directory \Users\usernamexxxx\AppData\Local\Temp there are thousands of files, so I removed them and now VS is much faster.

Is anyone else having similar issues?

4

There are 4 answers

0
Daryl On

I haven't had that type of error message, but the thing that always seems to slow down VS 2010 for me is the .suo (Solution User Options) file. It basically keeps track of what files you have open, and your break points, but it is an always growing file. When it get's up to 5mb, it can take 20-30 seconds for VS to respond at times when adding a file, or deleting one from the solution.

2
Nitin Vijay On

Yes, I have simmilar issue. when I clear My Temp Memory It works fine but after some time Temp directory is also showing some file.

and again the message comes "Out of Memory Exception".

It is an issue in Code. Your code is leaking memory. your code is not disposing object properly.

0
Kharaone On

I'm not familiar with this error in particular, but had an nasty issue back then with OutOfMemoryException during compile time for a big solution (more than 50 projects)

We used to circumvent it by using msbuild directly but debugging was a bit cumbersome

I checked on internet then and tried to extend the virtual memory that devenv.exe was using (by default it's 2GB). Being on a 64bit Windows 7, the OS was already complying with the fact that an application could use more than 2GB.

Just had to fire up a command prompt and type :

cd\
cd "C:\Program Files (x86)\Microsoft Visual Studio 10.0"
copy Common7\IDE\devenv.exe Common7\IDE\_devenv.exe
VC\bin\editbin.exe /LARGEADDRESSAW Common7\IDE\devenv.exe

After a reboot, the compilation Exception was just a mere dream.

Note : I read afterward that Visual Studio 2010 was supposed to be Large Address Aware out of the box, so it shouldn't have "solved" my issue, but it did for me.

0
RobSiklos On

I got tired very quickly of visual studio's slowness. My solution was to build everything on the command line using msbuild. I created a batch file which calls msbuild with my preferred options.

This option is actually really nice, because if you have a multi-core machine, you can pass the /m flag to msbuild, which will allow the build projects in parallel when possible (Visual Studio currently doesn't offer this functionality, but will in VS2012)

Calling msbuild is easy. For example:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe MyApplication.sln /m

Then, if I want to debug, I just build first (on the command line), run the app, and attach the visual studio debugger manually.