What’s the total amount of memory and swap a process is using

memoryswapwindows 7

http://windows.microsoft.com/en-us/windows/what-task-manager-memory-columns-mean#1TC=windows-7

If I'm reading correctly, there is no way to see how much swap is used by a process. Is this correct, or am I missing something?

Effectively, the Memory (Private Working Set) is the sum of both the in-memory and swap that's used by the process? Yes/No?

And Commit Size is effectively meaningless, since the description mentions that it's Virtual Memory, and Virtual Memory by itself is free anyways?

For a UNIX user, this terminology and descriptions by Microsoft seem quite confusing.

Best Answer

The Performance Monitor (perfmon.exe) has counters for process page file usage.

  1. Load perfmon up by either running "perfmon" on a command line, or by selecting "Performance Monitor" under Administrative Tools.
  2. Expand "Monitoring Tools" in the left column and select "Performance Monitor."
  3. Right-click on the graph to the right and select, "Add Counters."
  4. Scroll down the list of available counters to "Process."
  5. Click on the down-arrow icon to the right of "Process."
  6. Click on "Page File Bytes" under "Process"
  7. Select the desired process to monitor from the "Instances of selected objects" list.
  8. Click the "Add" button to put the counter under the "Added counters" list on the right.
  9. Click the "OK" button.

That will add a line that graphs the page file usage of the selected process, so it may not be very useful. You can use PowerShell to pull the data numerically:

Get-Counter '\Process(<process name>)\Page File Bytes'

Where <process name> is the name of the process according to Windows. You can get them all by using a wildcard:

Get-Counter '\Process(*)\Page File Bytes'

All processes will be listed, and the total usage for all processes will be at the bottom, with a process name of "_total".

Substitute other process counters to get the memory metrics that you are looking for.

Related Question