What performance counter is used to display total RAM usage on a Windows 2008 server?

I'm trying to use the Performance Counters so I can log the total RAM usage on a particular machine. I've got a sneaky feeling that it's maxing out (due to some bad code) ... server has a heart attack and it finally recovers a few mins later.

So to confirm this i'm trying to log it's memory usage.

I'm not sure which counter it is.

I'm used to using the Memory Usage graph that's part of the Task Manager.

Any suggestions?


First you need to understand that RAM usage is related to but not the same as memory usage. See my answer to this question for an explanation of how memory works in windows. That being said the counter that measures physical ram in use (commmit charge peak) is \Memory\Committed Bytes. You should see page faults long before the system actually uses up all the physical ram so check for page faults as well.

Before you start working on ram issues you should watch this webcast on how to troubleshoot memory problems in windows. Also see Pushing the Limits of Windows: Physical Memory