Sort Processes by Memory Usage with Get-Process

Rank running processes by working-set memory and CPU time in one PowerShell pipeline.

WindowsProcessesmemorypowershellLow risk
Run Get-Process | Sort-Object WS -Descending | Select-Object -First 15 to list the top 15 processes by memory.

01Command

Command
$ Get-Process | Sort-Object WS -Descending | Select-Object -First 15 Name, Id, @{n='Mem(MB)';e={[math]::Round($_.WS/1MB,1)}}, @{n='CPU(s)';e={[math]::Round($_.CPU,1)}} | Format-Table -AutoSize

02What it does

WS (working set) is the process's current physical RAM footprint; WSPrivileged/PrivateMemorySize64 differ subtly, and PrivateMemorySize64 is the better figure for commit-charge questions. Adding CPU seconds distinguishes a memory hog that is idle from one that is burning the machine. This pipeline is the fast console equivalent of sorting Task Manager's Details tab, and piping to Stop-Process -Id makes cleanup one step away.

03Risk

RiskLow risk
!Warning: Memory is shared — a large WS on the same hosting process (like several IIS app pools) does not mean several separate allocations.

04Undo

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

05Sources

  • Get-Process - SS64
    SS64 · technical · 2026-09-17
    Evidence: Shows sorting processes by working set and other memory-oriented examples.
  • Get-Process
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents Get-Process objects and their WS and CPU properties.

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

06Related solutions