My question is with regard to the .NET garbage collector. For any executing application, can I find out the number of times the GC 开发者_如何学运维has run (including the generation numbers for that collection) and how much time was spent on the same?
I could find a lot of explanation on the internal framework and working of the GC on sites as such msdn, red-gate, stack overflow etc. but none on the above question.Thanks in advance,
Bharath KThis information is available in performance counters.
Go to Computer Management, Performance Monitoring, and add # Gen x Collections under .Net CLR Memory.
The exact steps vary by OS.
There are sveral performance counters which provide information about the .Net Memory status, including the Garbage collector. See: http://msdn.microsoft.com/en-us/library/x2tyfybc.aspx for details
Use Perfview to collect and display GC Performance stats in nice way. It outputs nice tables and also Excel files.
精彩评论