.NET Max Memory Use 2GB even for x64 Assemblies

后端 未结 2 594
孤城傲影
孤城傲影 2020-12-17 18:47

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.

Am I correct in assuming that if I have

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 19:18

    "In .NET 4 and earlier, no object could be larger than 2GB in size, even in 64-bit processes. For certain workloads that use large arrays, however, this size limit can be constraining. As such, .NET 4.5 supports lifting the limit for arrays in 64-bit processes, such that arrays may be larger than 2GB. This means, for example, that you could allocate an array of Int32.MaxValue Int32s, even though such an array will consume 8GB. Large objects in .NET are allocated on a special heap, known not coincidentally as the Large Object Heap (LOH); .NET 4.5 has also seen significant performance improvements to the LOH, including usage of better algorithms for managing free memory in the heap."

    http://msdn.microsoft.com/en-us/library/hh285054(v=VS.110).aspx

    http://blogs.msdn.com/b/somasegar/archive/2012/05/16/net-improvements-for-cloud-and-server-applications.aspx

提交回复
热议问题