11

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?

RobSiklos
  • 8,348
  • 5
  • 47
  • 77
ramnz
  • 631
  • 1
  • 6
  • 24
  • Just close VS, emptying the Temp folder isn't necessary. – Hans Passant Feb 17 '11 at 21:23
  • Is there another way? I'm getting this exception 5-6 time per days – J4N Mar 24 '11 at 07:50
  • 1
    How much system memory do you have? – Derrick Jul 20 '11 at 23:50
  • are you running windows 7 on 64bit or 32bit? – Jehof Sep 05 '11 at 11:59
  • I assume this is a Silverlight project? Does compiling actually finish and it's just the xap packaging that fails? – Matt Sep 09 '11 at 03:51
  • This is a bug. Lots of people are getting it. Happens to me and rest of team a few times a day. – NabilS Oct 19 '11 at 22:17
  • Having this problem also, started appearing as the solution got that bit bigger. Closing and reopening VS works but is not the answer, doing this 6 or more times a day is just a pain. Its surely an issue with VS, but what is the solution??? My machine has 4 Gb of memory. Its putting me off using SL!!! – David Nov 18 '11 at 18:43
  • Bought i7 desktop has 8GB Ram solved this issue :) Otherwise clean delete generated codes,restart VS2010 many times,free your RAM. It was really annoying. – Davut Gürbüz May 09 '12 at 11:18
  • Davut .... don't worry you'll get back to the same stage in a while...we did the same. is VS2010...and if you have code rush is worst(devexp sorry to say this). – ramnz May 10 '12 at 14:34
  • Davut...how big is your app (number of proj and files?) – ramnz May 10 '12 at 14:36

4 Answers4

2

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.

Nitin Vijay
  • 1,414
  • 12
  • 28
0

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.

Daryl
  • 18,592
  • 9
  • 78
  • 145
0

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.

RobSiklos
  • 8,348
  • 5
  • 47
  • 77
0

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.

Kharaone
  • 597
  • 4
  • 16