Is it possible to stop .NET garbage collection?

前端 未结 4 1038
Happy的楠姐
Happy的楠姐 2020-12-17 17:37

Is it possible for a programmer to programmatically start/stop the garbage collection in C# programming language? For example, for performance optimization and so on.

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-17 18:16

    No, there is not. At best you can trigger garbage collection yourself, though this is considered to be a Very Bad Thing since it can interfere with the built in scheduling algorithms used by the GC.

提交回复
热议问题