Suppressing C# garbage collection

后端 未结 6 1074
挽巷
挽巷 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 10:05

    It will only (usually) happen when the GC needs some gen2 memory anyway (because gen1 is full). Are you asking this speculatively, or do you actually have a problem with GC taking a large proportion of your execution time? If you don't have a problem, I suggest you don't worry about it for the moment - but keep an eye on it with performance monitors.

提交回复
热议问题