Use Powershell to find out what uses lots of memory (on 64 bit Windows)

Here's a way to get info on currently running processes and sort by Working Set size

Get-Process | Sort-Object -Descending WS

Assign that output to a variable and it'll give you an array of the results, then you can just write out the first member of the array (which in this case will be a System.Diagnostics.Process object).

$ProcessList = Get-Process | Sort-Object -Descending WS
Write-Host $ProcessList[0].Handle "::" $Process.ProcessName "::" $Process.WorkingSet

Here's another quick and dirty script to dump a few items of data from the list of currently running processes using WMI's Win32_Process provider:

$ProcessList = Get-WmiObject Win32_Process -ComputerName mycomputername
foreach ($Process in $ProcessList) {
    write-host $Process.Handle "::" $Process.Name "::" $Process.WorkingSetSize
}

That'll list the PID (handle), process name and the current working set size. You can change that up using different properties of the WMI Process class.


One liner to find the name of your highest memory usage process

Get-Process | Sort-Object -Descending WS | select -first 1 | select -ExpandProperty ProcessName