.NET内存溢出异常 - 使用1.3GB,但已经安装了16GB [英] .NET Out Of Memory Exception - Used 1.3GB but have 16GB installed

查看:452
本文介绍了.NET内存溢出异常 - 使用1.3GB,但已经安装了16GB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个内存溢出异常在我的C#应用​​程序时,该应用程序的内存使用量越过约1.3GB。

I am getting an Out Of Memory exception in my c# application when the memory usage for the application goes over about 1.3GB.

我有一个32位的机器上同样的问题,3GB内存,这是有道理的,但今天,我现在拥有16GB内存的高升级硬件64位机 - 年底主板和内存,但内存溢出异常1.3GB!后,仍出现

I had this same problem on a 32-bit machine with 3gb of memory and it made sense back then, but now I upgraded the hardware to a 64-bit machine with 16GB memory with the high - end motherboard and RAM but the Out Of Memory exception still occurs after 1.3GB!

我知道,有超过2GB的没有一个单一的对象和1.3是少2GB无论如何,所以对单个对象的内置MS 2GB的限制不太可能是问题...

I know that there are no single objects over 2GB and 1.3 is less the 2GB anyway, so the in-built MS 2GB limit on a single object is not likely to be the problem...

好像有一个窗户杀死开关某种当应用达到一定的内存使用量阈值......那么就应该有配置,这是在注册表中可能的一种方式?

It seems like there is a windows kill-switch of some sort when an app reaches a certain memory usage threshold... Then there should be a way to configure this is in the registry perhaps?

任何帮助将大大AP preciated!

Any help will be greatly appreciated!

推荐答案

有什么区别,直到你的编译的以相同的目标架构。 我料想要编译支持 32 位在两种情况下的架构。

There is no difference until you compile to same target architecture. I suppose you are compiling for 32 bit architecture in both cases.

这是值得一提的是, OutOfMemoryException异常如果你也可以提高 2GB 由一个单一的集合中分配的内存在这两种体系结构 32 64 列表< T&GT) $ C>位。

It's worth mentioning that OutOfMemoryException can also be raised if you get 2GB of memory allocated by a single collection in CLR (say List<T>) on both architectures 32 and 64 bit.

要能够从内存善良的 64 位架构中获益,你要的编译的您code目标 64 位架构。在这之后,自然,你的二进制文件将运行的 64 位,但将受益于可能具有RAM更多的可用空间。

To be able to benefit from memory goodness on 64 bit architecture, you have to compile your code targeting 64 bit architecture. After that, naturally, your binary will run only on 64 bit, but will benefit from possibility having more space available in RAM.

这篇关于.NET内存溢出异常 - 使用1.3GB,但已经安装了16GB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆