Suppressing C# garbage collection

后端 未结 6 1080
挽巷
挽巷 2021-02-08 09:26

My application allocates a large amount of memory (millions of small objects totaling several gigabytes) and holds onto it for a long time.

  1. Is .NET wasting time ch
6条回答
  •  梦如初夏
    2021-02-08 09:57

    Look at the System.Runtime.GCSettings.LatencyMode property.

    Setting the GCServer property to true in the app.config will also help cut down on GC's (in my case 10 times less GC when enabled).

提交回复
热议问题