Can you use List> to get around the 2gb object limit?

后端 未结 5 1109
逝去的感伤
逝去的感伤 2021-02-18 22:28

I\'m running up against the 2gb object limit in c# (this applies even in 64 bit for some annoying reason) with a large collection of structs (est. size of 4.2 gig in total).

5条回答
  •  没有蜡笔的小新
    2021-02-18 23:20

    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.

提交回复
热议问题