My application allocates a large amount of memory (millions of small objects totaling several gigabytes) and holds onto it for a long time.
- Is .NET wasting time checking through all of this data to do GC on it?
- How often does the Gen 2 GC occur (the one that checks all objects)?
- Is there any way to reduce it's frequency or temporarily suppress it from occurring?
- I know exactly when I am ready for a large amount of memory to be collected, is there any way to optimize for that? I am currently calling GC.Collect(); GC.WaitForPendingFinalizers(); at that time.
Update: Perf counter "% Time in GC" is showing an average of 10.6%.