When you are debugging an application, there are many tools and techniques you can use, like logs, memory dumps and Event Tracing for Windows (ETW). In this post, we will talk about Time Travel Debugging, a tool used by Microsoft Support and product teams and more advanced users,
.NET CLR Memory\% Time in GC counter and !runaway on thread(s) doing GC.
The 2 common ways people use to look at the time spent in GC are the % Time in GC performance counter under .NET CLR Memory, and the CPU time displayed by the !runaway debugger command in cdb/windbg.
Both the !SOS.gchandles command (added in CLR 2.0) and the .NET CLR Memory\# GC Handles counter show you the number of GC handles you have in your process.
The # GC Handles counter is one of the rare counters in the .NET CLR Memory category that doesn’t get updated at the end of each GC.
So, there are many perf tools and some of them report either the same or the same type of data. I want to talk about various differences between the ones related to managed heap investigation. This is not supposed to cover everything..just the ones I think people use frequently.
Last time I talked about the hang scenario where your process is taking 0 CPU and the CPU is taking by other process(es) on the same machine.
The next scenario is your process is taking 0 CPU and the CPU is barely used by other processes.
!address is a very powerful debugger command. It shows you exactly what your VM space looks like. If you already got the output from the !sos.eeheap -gc command (refer to this article for usage on sos), for example:
0:003> !eeheap -gcNumber of GC Heaps: 1generation 0 starts at 0x01245078generation 1 starts at 0x0124100cgeneration 2 starts at 0x01241000ephemeral segment allocation context: (0x0125a900,
We have a new MSDN article out in the November issue that talks about investigating managed memory issues.
Take a look and let me know what you think.
Oh, and it’s also in 6 other languages (German, Spanish, French, Russian, Portuguese and Chinese) for readers that prefer one of those languages.
I was writing an internal wiki page on performance and thought this info is useful to many external readers as well so here it goes.
vadump is a good start. It’s an mstools tool – meaning you can find it on your NT CD under bin\mstools.