If it is 32-bit application, You are rightly getting OutOfMemoryException
. For this size requirements you need to target X64.
At i = 49000, Total memory = 49000*4600*8 = 1803200000 bytes = ~1.68GB.
Now For 32-bit applications (targeted X86), Total User Memory avaiable to an application is 2GB (unless the application is Large address aware, .NET application - Large Address Aware and OS is also enabled for this. Ex: (for)Vista. Then there is some CLR overhead, then application overhead.
At i = 120000, You need total memory as Total memory = 120000*4600*8 = 1803200000 bytes = ~4.11GB. (Platform target should be X64)