How to determine if GC.Collect () has been started manually?

I suspect that the library I use is fiercely invoking GC.Collect(), which causes problems. How can I confirm whether such an assembly actually starts manually?

My program has high memory bandwidth, but many 100 Gen 2 collections per second still seem very unlikely to me, especially considering that it only uses 100 MB of RAM.

+4
source share
1 answer

To do this, there is a performance counter "Induced GC" goes out every time GC.Collect () is called. Use Perfmon.exe to look at it, right-click on the graph> Add Counters> .NET CLR Memory> # Induced GC> select your exe.

A nice decompiler is always useful (ILSpy, Reflector, etc.), you can tell the author exactly what method he needs to fix.

+4
source

Source: https://habr.com/ru/post/1652355/


All Articles