c# string interning

前端 未结 4 2269
时光取名叫无心
时光取名叫无心 2020-12-17 19:10

I am trying to understand string interning and why is doesn\'t seem to work in my example. The point of the example is to show Example 1 uses less (a lot less memory) as it

4条回答
  •  自闭症患者
    2020-12-17 19:31

    From the msdn Second, to intern a string, you must first create the string. The memory used by the String object must still be allocated, even though the memory will eventually be garbage collected.

提交回复
热议问题