Why the allocation of a byte array with the size int.MaxValue fails
byte[] array1 = new byte[int.MaxValue]; // throws an OutOfMemoryException
and the allocation of two arrays with the size int.MaxValue / 2 does not?
byte[] array2 = new byte[int.MaxValue / 2];
byte[] array3 = new byte[int.MaxValue / 2];
The maximum size of an object in .NET is 2GB: http://blogs.msdn.com/b/joshwil/archive/2005/08/10/450202.aspx
int.MaxValue + the array overhead is slightly greater than 2 GB.