Jun 28, 2012

CPU 100% Busy?

This same problem has bitten me twice, once in 2009 and once in 2012 so it's worth a post.

If your computer is approaching old age (if it's a laptop that can be the ripe old age of 2) and seems to need a walker to keep moving the Task Manager application can be your best friend. Right-click on the status bar in an empty area and from the popup select Start Task Manager. In the View menu select Show Kernel Times. Now the red portion of the graph is showing you low level kernel time being used by the CPU. Typically this will be very low. When your CPU is busy and a significant portion of the graph is red, beware!

If you're running a particular application and it always starts consuming 100% of your CPU, the application may not be to blame. It could very well be your hard drive. It just so happens that this application writes out temporary files and it's the first application to run across the bad portion of your hard drive.

The first time I experienced unusually high CPU usage it was happening all the time so it was easy to see the problem as systemic. The next time it only happened when I was in Visual Studio and even then only when using ReSharper and even then only when viewing .xaml files. At first I even thought I narrowed it down to the use of the color settings on the .xaml files. All of these were red herrings. ReSharper does create lots of files to speed up usage and the problem was probably due to corruption of these files.  I should have become more suspicious when Skype also started consuming all my CPU (turns out it creates a lot more temporary files than you would think).

Still not convinced it's your hard drive? Run SpinRite and find out. No, Steve Gibson didn't pay me to say that. It's just that I have used it to rescue data from three different systems and it has proven to be well worth the purchase price. If I had used it in maintenance mode every couple of months I probably would have saved myself a lot of pain. Running it will not only confirm that you have hard drive damage it will do its darndest to recover your data. This can be very, very slow so you want to start this process when you have a couple of days to let it run. If you don't have any damage it will take hours instead of days, the time depends on many factors including the speed of your HD and its size.

If I don't have a recent back-up that I'm confident doesn't have damage, I run SpinRite to recover as much data as possible. If SpinRite can't recover data it will tell you so you'll know you have to keep an eye out for apps that don't behave right even after a HD replacement. Once SpinRite finishes I do a fresh backup. Then I purchase a new hard drive (moving to a SDD drive takes the sting out of this) and restore my backup onto the new drive. I detailed the process on another blog post.

I just wanted to make this post to EMPHASIZE that seeing unusually high CPU usage is commonly (in my experience) a result of a bad HD.

About Me

My photo
Tod Gentille (@todgentille) is now a Curriculum Director for Pluralsight. He's been programming professionally since well before you were born and was a software consultant for most of his career. He's also a father, husband, drummer, and windsurfer. He wants to be a guitar player but he just hasn't got the chops for it.