Exception of type 'System.OutOfMemoryException' was thrown.

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.] 在装有4G物理内存的32位OS机器上内存不足,原因是:The common language runtime throws an OutOfMemoryException error if it cannot allocate physical memory—or reserve sufficient virtual memory (VM)—to fulfill allocation request. By default, the addressable virtual memory space that is available for the process is 2 GB. If the virtual address space is exhausted, the operating system cannot allocate more physical memory for the process.

解决方法

解决方法是两步:1. 配置机器boot.ini 为/3g 内存选项 2. 配置VS2010支持3G内存模式 (如果你是64位Win7或者WindowsServer2003 64位,请自动忽略本文)

To enable this feature, add the /3GB switch to the Boot.ini file. This enables applications to use the first 3-GB of the address space on the following systems:

  • Windows Vista
  • Windows Server 2003
  • Windows XP Professional
  • Windows 2000 Datacenter Server
  • Windows 2000 Advanced Server
  • Windows NT Server 4.0 Enterprise Edition

配置boot.ini支持 / 3G

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Professional" /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP Professional 3GB switch" /3GB /USERVA=2900 /fastdetect /NoExecute=OptIn

 

配置VS2010支持3g内存

Using the Visual Studio command prompt, cd到\Microsoft Visual Studio 10.0\Common7\IDE\,然后执行command: editbin /LARGEADDRESSAWARE devenv.exe

 

重启机器即可。(参考资料:这个这个这个,和这个

posted on   Mainz  阅读(2319)  评论(0编辑  收藏  举报

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· [AI/GPT/综述] AI Agent的设计模式综述

导航

统计

点击右上角即可分享
微信分享提示