10

Apparently, as per Commit charge is 100% full but physical memory is just 60% when using no page file and http://brandonlive.com/2010/02/21/measuring-memory-usage-in-windows-7/, the Commit numbers in Windows 7 Windows Task Manager include both the physical and the swap memory, and count the virtual memory that has been allocated, but not necessarily has ever been used yet (i.e. not necessarily backed up by any physical source).

As such, is there a way to know the actual swap usage on the system? Simply subtracting physical memory from the Commit numbers won't work, as it apparently includes this unused-but-allocated space, too.

I mean, Windows 7 is supposedly a modern operating system; surely it must have the functionality to see how much of the swap space is actually presently being utilised, right?

2

1 Answer 1

19

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

  1. Load it 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 "Paging File."
  5. Click on the down-arrow icon to the right of "Paging File."
  6. Click on "% Usage" under "Paging File" and then click the "Add" button to put the counter under the "Added counters" list on the right.
  7. Click the "OK" button.

The graph will now contain a line for the page file utilization percentage.

11
  • 4
    Sorry, forgot to add that you can also get numeric results and add to scripts by using PowerShell: Get-Counter '\Paging File(*)\% Usage'
    – Memitim
    May 21, 2015 at 3:20
  • that seems a bit too complicated, especially considering that the upper limit is flexible and not set in stone. is there a way to get a number in GB or MB, instead of percentage points? also, is it the actual usage, or merely the commit minus the physical amount of DDR3?
    – cnst
    May 21, 2015 at 3:23
  • 3
    Should be actual usage. "Should" because it is a black box check, so no way to verify the source, but it appears accurate in testing. As for getting a numeric quantity, either multiply the % usage by the page file size or get total page file usage of all processes in bytes: get-counter '\Process(_total)\Page File Bytes'
    – Memitim
    May 21, 2015 at 3:35
  • Where do I input the code as you provide? Also, what kind of testing did you do -- did you try to allocate several gigs of RAM, to see Commit grow by said number (and exceed physical memory), but the Paging File counter remain the same?
    – cnst
    May 21, 2015 at 3:40
  • 1
    You can either open a PowerShell command window and run the commands, or you can open a regular command window, type "powershell", and then type the command; i.e. powershell 'get-counter '\Process(*)\Page File Bytes'. You can also just type "powershell" by itself and hit enter to have the command window change to the PowerShell shell.
    – Memitim
    May 21, 2015 at 3:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .