Looking at the processes of one of my servers, I notices a huge memory consumption on one of the w3wp.exe’s running on the Moss server. Immediately I wanted to find out which SharePoint Webapp is causing this. And there I was….. Well you need to know the Process ID first (View -> Select Columns… in Task Manager) and then you can use the iisapp.vbs tool that comes with IIS.
I found this information on the this post from the Thoughts about IIS (and now SharePoint blog) which describes the following:
During the course of working through issues, I get asked at least twice a week how to determine which application pool maps to a particular worker process PID (Process ID) on a server. I suppose there are lots of ways to determine this, but here two that come to mind to determine the answer.
The first way, and by far the easiest, is to use one of the new scripts that come in the box called IISAPP.VBS. It is located in the %SystemRoot%\system32 directory. For example:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
W3WP.exe PID: 1172 AppPoolId: StsAdminAppPool
As you can see, this script makes it very easy to determine what the PID is of each specific Application Pool. This is nice to use when trying to determine which PID you may want to snap a dump of for debugging purposes.