windows Visual Studio 2010——如何减少其内存占用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3054504/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2010 -- how to reduce its memory footprint
提问by GregC
I have a solution with just under 100 projects in it, a mix of C++ and C# (mostly C#). When working in VS2005, the working set of Visual Studio is considerably smaller than that of VS2010.
我有一个解决方案,其中包含不到 100 个项目,混合了 C++ 和 C#(主要是 C#)。在 VS2005 中工作时,Visual Studio 的工作集比 VS2010 小很多。
I was wondering if there are some things that can be turned off, so I can develop in VS2010 under 32-bit OS without running out of memory.
想知道有没有可以关掉的东西,这样我就可以在VS2010 32位操作系统下开发,不会出现内存不足的情况。
采纳答案by Noah Richards
You can try using the Solution Load Manager. It'll let you mark some of the projects files as load on demand or not load at all. That may help.
您可以尝试使用解决方案负载管理器。它可以让您将一些项目文件标记为按需加载或根本不加载。那可能会有所帮助。
回答by Dave Markle
A 64-bit OS should help you out a bit here, if you get more than 4GB of physical RAM. A 64-bit OS can provide 32-bit processes with a full 4 GB of virtual memory, whereas a 32-bit OS only can provide 2 or 3 gigs at best, depending on how you boot the OS.
如果您获得超过 4GB 的物理 RAM,64 位操作系统应该可以帮助您。64 位操作系统可以为 32 位进程提供完整的 4 GB 虚拟内存,而 32 位操作系统最多只能提供 2 或 3 个演出,具体取决于您启动操作系统的方式。
That being said, 100 projects is a pretty fat solution file. Maybe now would be a good time to reexamine that decision...
话虽如此,100 个项目是一个非常胖的解决方案文件。也许现在是重新审视这个决定的好时机......
EDIT: Running dumpbin /headers as prescribed in the article for DEVENV.EXE returns:
编辑:按照 DEVENV.EXE 文章中的规定运行 dumpbin /headers 返回:
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
14C machine (x86)
4 number of sections
4BA1FAB3 time date stamp Thu Mar 18 06:04:35 2010
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
122 characteristics
Executable
Application can handle large (>2GB) addresses
32 bit word machine
So that would indicate that an x64 box with > 4GB of RAM will probably improve your experience. You should have up to twice as much VM available for Visual Studio under a 64-bit OS...
因此,这表明具有 > 4GB RAM 的 x64 盒子可能会改善您的体验。在 64 位操作系统下,Visual Studio 可用的虚拟机数量应该是原来的两倍……
回答by JaredPar
The best thing you can do is to split up your solution. Visual Studio wasn't meant to handle so many projects in the same solution and does suffer performance problems as a result. Splitting up your solution into 5 different ones will make things better.
您能做的最好的事情就是拆分您的解决方案。Visual Studio 并不打算在同一个解决方案中处理如此多的项目,因此确实会遇到性能问题。将您的解决方案分成 5 个不同的解决方案会让事情变得更好。
回答by Chris Dennett
If you're on XP, upgrading to Vista or Windows 7 will help as it uses WPF. May reduce the memory footprint of the UI rendering which would otherwise have to use compatibility mode.
如果您使用的是 XP,升级到 Vista 或 Windows 7 会有所帮助,因为它使用 WPF。可以减少 UI 渲染的内存占用,否则必须使用兼容模式。