Tuesday, April 29, 2008

Cpu usage going to 100% when pc idle


Since months each time I let my pc idle it would go in idle mode. Nothing special here.

However some process was doing something in the background when my pc should have been idle. This didn't bothered me because each time I used my pc again this process would stop. Hence I thought it was a "normal" Windows process doing some small maintenance.

Recently I began to have doubts.

To pinpoint the problem I used the excellent free must-have tool ProcessExplorer. (At least grab it before Macro$ begins to charge for it ;)

After lauching ProcessExplorer I waited until my pc got idle and this mysterious process began (= gone taking a cup of coffee). When I cam back it was running so I looked at ProcessExplorer and saw that it was a SVCHOST.exe running at 80-100% cpu!! Ouch!

That's much badder than I thought but strangely the pc didn't seem to heat so much - hence the fan didn't turn like mad and the reason it didn't realise the problem sooner.

ProcessExplorer told me numerous services are associated with this SVCHOST and my suspicion quickly turned to the "System Restore Service".

Some browsing helped me found this trick which indicate that some infinite loop was happening:

http://cboard.cprogramming.com/showthread.php?t=81209

  • Open a dos shell window. By clicking “Start/Run”, type in “cmd.exe” and hit enter.
  • Stop the Windows Management service: "net stop winmgmt"
  • Delete the Repository folder: "rd /s /q c:\windows\system32\wbem\Repository\"
  • Restart the Windows Management service: "net start winmgmt"
  • Recompile all the "Managed Object Format" files (*.mof,*.mfl):
  • a - "cd /d c:\windows\system32\wbem\"
  • b - "for %i in (*.mof,*.mfl) do Mofcomp.exe %i"
  • Verify the folder "c:\windows\system32\wbem\Repository\" has been recreated. If not, restore your system and try again or look for another solution. :-)

This trick worked for me.
I should have done this a long time ago.


I didn't need to try this other trick: "Problem with High CPU Usage with SVCHost.EXE : cpu, usage, high".

If none work for you you will probably need to use ProcessExplorer and stop one-by-one the programs linked to the SVCHOST.exe to find the culprit and decide either to leave it stopped or correct it by reinstalling it.

Also don't forget to update you anti-virus, spyware etc as it could be a corrupt service.

Good luck

No comments: