C# Large objects and heap

后端 未结 2 457
太阳男子
太阳男子 2021-02-08 21:19

I am a bit confused about the storage of large objects within the heap.. Like at what size is the object cosidered large? What types are more likely to be treated as large objec

2条回答
  •  名媛妹妹
    2021-02-08 21:55

    The general rule is: If the size of the object is 85000 bytes or more it is considered large and will be place on the LOH.

    For some reason double[] is treated differently, so any array of doubles with 1000 or more elements go on the LOH as well. I haven't seen any official documentation for this implementation detail, but it is fairly easy to verify.

提交回复
热议问题