The Limitation On the Size of .Net Array

后端 未结 5 592
北荒
北荒 2020-11-28 13:32

I heard that there is a hard limit on the size of .Net Array. It is said that the maximum amount of memory that can be allocated to any single instance of an

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 14:08

    In versions of .NET prior to 4.5, the maximum object size is 2GB. From 4.5 onwards you can allocate larger objects if gcAllowVeryLargeObjects is enabled. Note that the limit for string is not affected, but "arrays" should cover "lists" too, since lists are backed by arrays.

提交回复
热议问题