We have a theory that gen 2 GCs could be introducing delays into an application, is there a way to profile how long GCs take?
Asked
Active
Viewed 1,801 times
9
-
Also see http://stackoverflow.com/questions/4288898/how-to-profile-net-garbage-collector. – John Pick Feb 23 '11 at 21:36
3 Answers
5
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.

TToni
- 9,145
- 1
- 28
- 42
-
4I'm looking specifically for how long a single full GC takes. Is it suspending everything for 10 ms... 100 ms... 500 ms. – rjdevereux Feb 24 '11 at 18:04
3
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?
0
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

rjdevereux
- 1,842
- 2
- 21
- 35