Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
On 64-bit platforms, enables arrays that are greater than 2 gigabytes (GB) in total size.
<configuration>
<runtime>
<gcAllowVeryLargeObjects>
<gcAllowVeryLargeObjects enabled="true|false" />
Attribute | Description |
---|---|
enabled |
Required attribute. Specifies whether arrays that are greater than 2 GB in total size are enabled on 64-bit platforms. |
Value | Description |
---|---|
false |
Arrays greater than 2 GB in total size are not enabled. This is the default. |
true |
Arrays greater than 2 GB in total size are enabled on 64-bit platforms. |
None.
Element | Description |
---|---|
configuration |
The root element in every configuration file used by the common language runtime and .NET Framework applications. |
runtime |
Contains information about runtime initialization options. |
Using this element in your application configuration file enables arrays that are larger than 2 GB in size, but does not change other limits on object size or array size:
The maximum number of elements in an array is UInt32.MaxValue.
The maximum size in any single dimension is 2,147,483,591 (0x7FFFFFC7) for byte arrays and arrays of single-byte structures, and 2,146,435,071 (0X7FEFFFFF) for arrays containing other types.
The maximum size for strings and other non-array objects is unchanged.
Caution
Before enabling this feature, ensure that your application does not include unsafe code that assumes that all arrays are smaller than 2 GB in size. For example, unsafe code that uses arrays as buffers might be susceptible to buffer overruns if it's written on the assumption that arrays will not exceed 2 GB.
The following app.config file snippet shows how to enable this feature for a .NET Framework application.
<configuration>
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
</runtime>
</configuration>
.NET Framework 4.5 and later versions
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now