The purpose of my presentation was to show some common pitfalls and of course to show off windbg and sos just to show people that if you have a hang, perf issue, memory leak or crash, there are tools out there that can help you figure out the root cause so that you don’t have to resort to guessing.
The site I used for the presentation is attached to this blog post.
is a summary of the topics I covered.
Hangs and Performance issues
First I debugged a simple hang (using locks in conjunction with long running operations) to show the power of windbg and sos, and to show off a few of the commands. (more info)
After this I went into a high CPU in GC scenario with string concatenation and showed a simple example where I reduced the execution time of a page assembling an XML file from 6 seconds to ~2 ms by changing from using string concatenation to using StringBuilder. I had a brief spiel about how the GC works and why string concatenation caused high CPU in GC. (more info)
And finally i showed how you can log application restarts.
In the memory section I showed a few different leaks caused by blocked finalizers and storing a lot of data in cache/session. And I also showed how you can display all the session variables in a memory dump in order to investigate issues with high memory usage in session variables.
Exceptions and Crashes
I ended off the talk with a discussion on what can cause a crash and why you get out of memory exceptions and finally showed how simple it is to log exceptions using windbg, something I think all developers should do during the testing phase to get a feel for how many exceptions and what types of exceptions their application throws during normal working conditions.
The full presentation has a few more topics but one hour is a bit too short to cover everything:)