I know that there's a 2 GiB limitation on all objects in .NET (either in x86 or x64 architecture) and due to memory fragmentation and .NET overhead, you can use up to 1.2-1.4 GB of your application virtual memory before you get OutOfMemory Exception. So when I do:
int[] array1 = new int[300 * 1000 * 1000];//about 1.1 GB
for 32-bit application on 64-bit OS, I get OutOfMemory Exception which is predictable. but when compiled to 64-bit, the CLR is able to allocate memory on heap and no runtime errors occurs.
What happens that CLR is able to find contiguous block of memory when the application is compiled to x64 that it cannot do for x86 platform target?
Thanks.