Welcome to MSDN Blogs Sign in | Join | Help

Mebyon Kernow

A blog by Morgan
Differentiating process instances in Perfmon

If you’re running in a terminal services environment, or have multiple instances of a given application running on your machine, this tip will help you to work out which process is which in Perfmon. To see the issue, I’ve created a simple Windows Forms application and run up three instances of it on my machine. When I go into Perfmon, which process is which?…

RightProcessPerfmon1

You’ll see here that I have 3 instances of my test application - TestWinFormsApp, TestWinFormsApp#1 and also TestWinFormsApp#2. So, if I want to capture counters for a specific one of these (and maybe do some other stuff like taking process dumps at the same time) how can I do that as I don’t know the process ID?

Well, you can use Perfmon to display the process ID for you. Scroll down to the ‘Process’ section, choose ‘ID Process’ and then select your process instances and click on Add.

RightProcessPerfmon2

You’ll then have the process ID captured for you by Perfmon – it’s shown as all of the figures on the graph, so in the following my process ID is 5896…

RightProcessPerfmon3

Armed with the knowledge of the process ID, you can now capture Perfmon stats for a given instance (say TestWinFormsApp#1 in the above), and also use adplus –hang –p 5896 to get a memory dump of the same process at the same time. I needed this information to help a customer take some memory dumps and perfmon stats for me, so thought it might come in useful for someone else.

If you don’t know what adplus is, skip over to the Debugging Tools for Windows site, download and enjoy.

Posted: Wednesday, May 06, 2009 1:08 PM by morgansk
Filed under:

Comments

DotNetShoutout said:

Thank you for submitting this cool story - Trackback from DotNetShoutout

# May 7, 2009 3:20 PM
Anonymous comments are disabled
Page view tracker