问题描述
我读过(http://blogs.msdn.com/joshwil/archive/2005/08/10/450202.aspx)在.NET对象的最大容量为2 GB。
I've read (http://blogs.msdn.com/joshwil/archive/2005/08/10/450202.aspx) that the maximum size of an object in .NET is 2 GB.
我是正确的假设,如果我有一个对象,占用了256 MB的内存,因为它是引用类型,我能有这256 MB的对象,所有的对象组合在一起可以卷起> 2GB内存,只要数组作为参考数组的大小保持低于2 GB?
Am I correct in assuming that if I have an Object that takes up 256 MB Memory, since it is a reference type, I can have an array of these 256 MB Objects where all the objects together may takeup >2GB Memory as long as the size of the reference array stays below 2 GB?
推荐答案
是的,你的假设是正确的。
Yes, your assumption is correct.
2GB的限制适用于每个单独的对象。用于所有对象的总内存可以超过2GB。
The 2GB limit applies to each object individually. The total memory used for all objects can exceed 2GB.
(无论运行时能够分配足够的内存为您的要求是另一回事。我怀疑它是否能找到的32位机器上的备用存储一个完整的2GB,但它不应该是在64位的一个问题。)
(Whether the runtime is able to allocate enough memory for your requirements is another matter. I doubt if it could find a full 2GB of spare memory on a 32bit machine, but it shouldn't be a problem on 64bit.)
这篇关于.NET最大内存使用2GB甚至用于基于x64组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!