This one throws an OutOfMemoryException
.
Target framework .NET 3.5, running on a 64-bit Windows 2008 R2 Standard.
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
byte[] test = new byte[Int32.MaxValue];
}
}
}
According to documentation, array length must simply be a positive 32-bit integer but apparently that is not the only restriction to look out for.
Why does memory run out in this case?