↑ ↓ select, Enter open, Esc close

Show processes with the highest RAM usage

user@server
ps -eo pid,user,%mem,rss,cmd --sort=-rss | head -15

Sorts all processes by actually used memory (RSS, in KiB) and shows the largest. The %MEM column puts that in relation to total RAM. Useful before the OOM killer strikes or when the server starts swapping.

Note: With many identical processes (php-fpm, apache2), shared memory is counted for each of them, so the sum of RSS values is larger than the real usage.

Also searched as

  • which process uses so much ram
  • memory is full linux
  • find memory hogs
  • top processes by memory

Related one-liners

All in Processes

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.