Why am I getting a StackOverflowException when I specify the size of the INTEGER array to be 200,000,000?

200,000,000 is much less than the maximum 32-bit INTEGER, 2,147,483,647.

+2


source to share


1 answer


A stack overflow does not happen when your notation runs out of bits, but when your computer runs out of memory. An array of 200M records will require 800 MB of memory. It's very easy to put on the stack.



+11


source







All Articles