.NET Debugging for the Production Environment
60 likes | 208 Views
.NET Debugging for the Production Environment. Part 5: Debugging High CPU Hangs. Brad Linscott. Premier Field Engineering. Agenda. High CPU hangs Data to collect in production environment Common debugger commands for high cpu hangs Demo. High CPU Hangs.
.NET Debugging for the Production Environment
E N D
Presentation Transcript
.NET Debugging for the Production Environment Part 5: Debugging High CPU Hangs Brad Linscott Premier Field Engineering
Agenda • High CPU hangs • Data to collect in production environment • Common debugger commands for high cpu hangs • Demo
High CPU Hangs • When a single process consumes 90% or more cpu • Symptoms may include • Application that is non-responsive/very slow to respond • If it’s a desktop application consuming all the cpu on the box, then multiple apps on the desktop may be visually slow to respond • Quick check – Task Manager, Processes tab
Data to Collect for High CPU Hangs • If you can do a live debug, then break into the process during the high cpu and debug it. Otherwise… • “Ideal” data • Two or more dumps 30 seconds apart during the high cpu hang • Perfmon that includes Process & Thread objects • Beware of log file size over long time period • Minimum required data • One dump during the high cpu hang
Common Debugger Commands for High CPU Hangs • !runaway – beware of jumping to conclusions • To find the offending function(s), use stack & thread commands • Any variant of ‘k’ (kb, kn, kp, k, etc.) for native stacks • !psscorX.clrstack for managed stack (X=2, 4) • Other thread/stack commands • Sometimes we need help finding the executing line of code in the offending function • u;!u