If you’re going to look for memory leaks, you need Performance Monitor (perfmon).
Here is a method you can use to detect memory leaks:
First open Perfmon and select the .NET CLR Memory Performance object and the counter # Bytes in all Heaps for all your w3wp instances (w3wp#1, w3wp#2, etc).
With these counters you will be able to see if any w3wp process is accumulating memory. Leave this running for some hours and you will notice rapidly.
Now once you have determined a w3wp process that is leaking, you need to clearly identify it. Of course the w3wp#1 notation, isn’t helping here. So you need to find out what does it correspond to. In my previous post, I already mentionned that you can find out the Web Application if you have the Process ID. Clearly, in this case, we still need to find the process ID.
I have come across 2 methods for this:
1. You can set a registry key on your server(s) that will translate the w3wp#1 into w3wp_pid. See KB281884 for this (I hate setting registry keys if it can also be done without [:D] )
2. You can also find out this information using perfmon! Add the Performance object Process with the counter ID Process and for the instance of w3wp#… for which you want to know the pid. And voila, you get the Pid.
Now, using cscript iisapp.vbs you can find out the Web application that is leaking. With this information you can then check which solutions are deployed to this web application and you can already start with the fingerpointing [6] !
I want to thank my good friend and colleague Cedric Carrette for sharing this information with me.