I\'m trying to create an array of byte
s whose length is UInt32.MaxValue
. This array is essentially a small(ish) in-memory database:
The current implementation of System.Array
uses Int32
for all its internal counters etc, so the theoretical maximum number of elements is Int32.MaxValue
.
There's also a 2GB max-size-per-object limit imposed by the Microsoft CLR.
A good discussion and workaround here...
And a few related, not-quite-duplicate, questions and answers here...