Disposing a StringBuilder object

前端 未结 3 675
时光取名叫无心
时光取名叫无心 2021-02-11 20:36

How does one effectively dispose a StringBuilder object? If an user generates multiple reports in a single sitting, my app ends up using a huge amount of memory.

3条回答
  •  太阳男子
    2021-02-11 21:10

    If you are generating many reports, you could consider re-using a single StringBuilder instead of allocating a new one for each report.

提交回复
热议问题