Check Page File Size and Usage with PowerShell

Query Win32_PageFileUsage to see page file size, current usage, and peak usage — how close you are to memory exhaustion.

Windowsmemoryvirtual-memorypowershellLow risk
Run Get-CimInstance Win32_PageFileUsage | Select-Object Name, AllocatedBaseSize, CurrentUsage, PeakUsage — sizes are in MB.

01Command

Command
$ Get-CimInstance Win32_PageFileUsage | Select-Object Name, AllocatedBaseSize, CurrentUsage, PeakUsage

02What it does

The page file is the backup space on disk where Windows moves memory pages when RAM runs short. AllocatedBaseSize is the current page file size in MB, CurrentUsage is how much is in use right now, and PeakUsage is the highest since boot — a PeakUsage close to AllocatedBaseSize means the system has come near running out. That's the data you want before deciding to shrink it manually or add RAM. For a memory-starved PC this also explains slowdowns that Task Manager's percentage alone doesn't.

03Risk

RiskLow risk
!Warning: Don't disable the page file "to save disk space" — apps that expect it will fail with out-of-memory errors even when RAM is free. This command only reads data; it changes nothing.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Win32_PageFileUsage class
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Win32_PageFileUsage exposes AllocatedBaseSize (current MB), CurrentUsage and PeakUsage for each page file on the system.

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions