Best Practice for Forcing Garbage Collection in C#

前端 未结 15 2032
天命终不由人
天命终不由人 2020-11-22 12:28

In my experience it seems that most people will tell you that it is unwise to force a garbage collection but in some cases where you are working with large objects that don\

15条回答
  •  被撕碎了的回忆
    2020-11-22 12:36

    I've learned to not try to outsmart the garbage collection. With that said, I just stick to using using keyword when dealing with unmanaged resources like file I/O or database connections.

提交回复
热议问题