How do I find out (in Powershell) what process/whatever uses the most memory?
Edit: I am trying to figure out how to use Powershell to find out what's using all the physical memory in case Task Manager etc. fail to explain why all the physical RAM is used up. I.e. I need to identify memory used by caches etc.
Here's a way to get info on currently running processes and sort by Working Set size
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).
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:
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