ArticleDirectory
- Not enough storage ...?
- Its a software problem.
- The hack... err, solution.
- Look at all that memory!
Original address
Visual Studio can be a tremendous resource hog, especially if you
Have a large solution and you're using a productivity add-in or two.
On my current project we're running vs 2008, we're 've got just under 20 projects in the solution, and several of us are using the resharper 4.0 EAP nightly builds
To enhance our Dev-fu. And you know what... We're re restarting vs
Least a half dozen times a day to work around und a nasty exception we
Regularly encounter while trying to compile:
Not enough storage is available to complete this operation.
Not enough storage ...?
Yep-storage. But you shoshould readStorageTo meanMemory... Ram that is.
After
Running for a while the Visual Studio process (found under devenv.exe
In process Explorer) maxes out its available memory and the above
Exception is thrown. The only way to reclaim the memory and successfully
Compile the solution is to restart the process.Bummer!
Maybe we shoshould just upgrade our hardware, right?
I
Mean, with cost of processor cycles and ram falling as fast as gas
Prices are rising, why not just spend a few bucks and make sure we're
All running multi-core boxes with 4 + gigabytes of memory and storage
Space to burn. Well guess what... we are.
All of the developers
Are Running nice beefy machines with lots of RAM, super-fast processors,
And we even have nice 21 "wide screen DVI monitors. So this ain't no hardware problem.
Its a software problem.
I
Will admit, we are running a mix of 32-bit operating systems-mostly
Vista with a handful of XP machines mixed in for the Devs that roll that
Way. And Jeff Atwood has covered the missing Ram problem before, but even switching to a 64-bit OS wouldn't solve our problem. At least not entirely.
The
Problem is with Visual Studio. Being a 32-bit application its limited
To just 2 GB of virtual memory, even if its running in a 64-bit OS.
Least, its limited to 2 GB by default... but we canHack aroundChange that.
The hack... err, solution.
The first thing to do is tell the OS to increase the amount user-mode memory from 2 GB to 3 GB.If you're running a 64-bit you can skip this step.
Note:
The boot. INI is a hidden file at the root of C:. You have to go
Explorer/tools/options and set view to include system and hidden files.
Now you will be able to see it.
You can also go to run and type "Edit c: \ Boot. ini ".
Then we have make Visual Studio large address aware.
- Be sure to backup
Devenv.exe
- Using the Visual Studio command prompt, navigate
C: \ Program Files \ Microsoft Visual Studio 9 \ common7 \ ide \
- Execute the following command:
1:Editbin/largeaddressaware devenv.exe
Finally we'll use the old Microsoft-fix-all-reboot the machine.Bounce that box!
Look at all that memory!
At this point Visual Studio shocould be allowed to consume up to 3 GB of memory before throwing that uuglyOut of Memory exception.
Just to show you I'm not lying, I grabbed a screen shot of my process ExplorerDevenv.exe
Process chewing up greater than 2.5 GB of memory.Sweet!
Note:Even with our large solution and running the early,
And memory-hungry, resharper bits, Visual Studio typically stays around
Or just above the 2 GB mark. However it can spike up to 2.5 + GB while
Compiling, as show in this screen shot.
Notes: we also need to avoid binding errors in runtime.