2GB array size limit in .Net

Until 4.5 version, .Net restricts System.Array’s size to 2 Gb (like any single object) even in 64 bits environment.

Since .Net 4.5, a config entry can be used in 64 bits to permit greater size:

    <gcAllowVeryLargeObjects enabled="true" />

but Microsoft’s System.Array have index limited to Int32.MaxValue: 2147483647 (Mono can be use with configuration option –enable-big-arrays to use Int64 capacity – see here).

Another alternative can be to use it’s own big array like this one BigArray, getting around the 2GB array size limit – SpankyJ – Site Home – MSDN Blogs.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s