April 27, 2010
Blog ArchivesDebugging a classic ReaderWriterLock deadlock with SOSex.dll
I was helping out on an issue the other day where the process would stall if they added enough users in their load tests. Btw, serious kudos to them for making load tests, so much nicer to work with a problem in test rather than when it is getting critical on a production machine. We gathered some memory dumps with debug diag of the asp.net process (w3wp.exe) and found that most of the threads were waiting in this type of callstack: NOTE: I have changed a lot of function names and code snippets since it is not relevant for the post. 0:071> !clrstack OS Thread Id: 0x21ac (71) ESP EIP 1c8ceb88 7c8285ec [HelperMethodFrame_1OBJ: 1c8ceb88] System.Threading.ReaderWriterLock…(read more)
High CPU in .NET app using a static Generic.Dictionary
A couple of weeks ago I helped out on a high CPU issue in an ASP.NET application. Problem description Every so often they started seeing very slow response times and in some cases the app didn’t respond at all and at the same time the w3wp.exe process was sitting at very high CPU usage 80-90%. This started happening under high load, and to get the application to start responding again they needed to restart IIS. Debugging the problem They gathered a few memory dumps during the high CPU situation for us to review and when running the sos.dll command ~* e !clrstack (in windbg) to see what all the threads were doing we found that they were all stuck in callstacks similar to this one: OS Thread Id: 0x27dc (124) ESP …(read more)