I'd like to create two 200M int elements arrays. Like that:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Arr
{
class Program
{
static void Main(string[] args)
{
int Min = 0;
int Max = 10;
int ArrSize = 200000000;
int[] test2 = new int[ArrSize];
int[] test3 = new int[ArrSize];
Console.ReadKey();
}
}
}
However, under VS2013, I'm getting out of memory exception with yellow arrow pointing on int[] test3 = new int[ArrSize];
line. The machine has 12GB of RAM.
If I decrease number of elements to 150M no exception is thrown.
If I initialise only one array of size 200M, no exception is thrown.
Why?