.NET Collections and the Large Object Heap (LOH)

后端 未结 4 1334
渐次进展
渐次进展 2020-12-11 02:45

Are .NET collections with large number of items apt to be stored in the LOH?

I\'m curious about List and Dictionary specifically. In my code, I store a large number

4条回答
  •  天命终不由人
    2020-12-11 03:10

    List is implemented as an array. As such the array will be put into LOH, but the List object itself will not.

    The same basically applies to Dictionary as well. It too is using an array of buckets internally, which basically store the key/value pairs you add.

提交回复
热议问题