« Comment spam is no longer funny | Main | Bill Gates talks about blogging »

The bug that heated up the CPU!

Last week, one of the testers on my project filed an interesting bug. Apparently, loading one of the asp.net pages was taking too long. What's more, after a minute or so, the CPU would heat up so much that the fan would start whirring! Even though it wasn't assigned to me, the bug description was interesting enough to get me curious. The first step was to obviously break into the debugger. Since the page was taking very long to load, I suspected that a thread was blocking on something. It turned out that the main render thread was blocking in a "Array.Copy" operation. Looking at the call stack, it turned out that hundereds of deserialization operations were taking place. That gave me a clue. ASP.NET was trying to deserialize the Viewstate. A quick look at the code revealed that we were saving off a huge dataset in the Viewstate. Serialization and deserialzation are expensive operations and more so for a complex data type like datasets. We removed the dataset from the Viewstate and things cooled off considerably after that ;)

TrackBack

Listed below are links to weblogs that reference The bug that heated up the CPU!:

» Online Casino from Online Casino
Thank you for your interest in Online Casino. Testimony is no longer being taken for the 2002 budget. For more information on Online Casino click on any link listed to the left. Thank you for your interest in ... [Read More]

Comments

where's your blogroll?

Storing a dataset in the viewstate is one of the first mistakes that people make when they start with ASP.NET(did that in .NET B1 and learnt the lesson the hard way)

Sometimes it can be a silent killer as when you are testing you may have only a few records and everything works fine. In production, you find that you are suddenly getting a few thousands of records and you start getting strange "Internal Server errors" :-)

lake powell

Post a comment