How long does a GC take?
We have a the开发者_Python百科ory that gen 2 GCs could be introducing delays into an application, is there a way to profile how long GCs take?
There are performance counters for the total time spent in GC and various info about number of collections, heap sizes and so on. See this article for detailed instructions.
If you just want a quick look at an application, use the process explorer. It can show most of the .NET statistics for a process.
The .NET 4.0 has ETW for GC which can help in profiling the time spent on GC.
Here is an answer similar to your question Can you repro this 64-bit .NET 4 GC bug?
Perfview tracks all sorts of useful information about GC:
Downlaod: http://www.microsoft.com/en-us/download/details.aspx?id=28567
Blog post + Video: http://blogs.msdn.com/b/dotnet/archive/2012/10/09/improving-your-app-s-performance-with-perfview.aspx
精彩评论