Disposing a StringBuilder object

前端 未结 3 676
时光取名叫无心
时光取名叫无心 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:07

    Unless the 'excessive memory usage' is a problem, I would leave it as it is and not worry about it.

    .NET is in most cases smart enough to avoid doing a garbage collection if you have enough memory available.

提交回复
热议问题