Thursday, August 14, 2008

which services are hiding inside svchost.exe ?

if you're like me, you probably spend far too much time inside the task manager, trying to identify which applications are hogging too many resources, and what bottlenecks might be present in the system.

it's not too uncommon to see one of the many svchost.exe processes using lots of resources, but it's not easy to identify what's causing the problem here.

for those who don't know, svchost.exe is simply a process wrapper for windows services. each svchost.exe "contains" a bunch of windows services. so when one of these is maxing out the CPU or using far too much RAM, it can be useful to know which services are relevant - then you can begin stopping or restarting them to see which one is causing the problem.

there's two methods for identifying what services are hiding within each svchost.exe

the first one uses the "tasklist" command-line application.

note : tasklist is only included in XP professional, however it can easily be downloaded for use on XP home. there's many links to be found on google, here's one : http://www.computerhope.com/download/winxp/tasklist.exe

firstly however, we need to make sure we can see the process ID for each process in the task manager. in the task manager, go to the view menu and click "select columns". in the dialog that pops up, make sure "PID (process identifier)" is enabled, and click OK. then sort the process list alphabetically by clicking on the "image name" heading, this way all the svchost.exe processes are grouped together. check which one is causing the problem and make a note of it's PID.

at the command prompt, type exactly as written (including quotes) :

tasklist /svc /fi "imagename eq svchost.exe"

this will list all of the svchost processes with their relevant process ID and what services each one contains. find the one with the PID that matches the one you made a note of earlier - and check the services listed under that one.

the other (and possibly much simpler) solution is to use process explorer from system internals (recently acquired by microsoft), you can download this from http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

it's an alternative to the task manager, and a big improvement too. it shows what services are active inside each svchost.exe, so while it won't list all the services contained within each one, you would expect the one causing a problem to be listed as it would be active.

No comments: