To sort processes by memory usage while the top command is running, you can use a simple keyboard shortcut:
Press M (Uppercase 'M').
Once you press it, the table will immediately reorder itself based on the %MEM column, putting the applications consuming the most RAM at the top.
Quick Summary of Sorting Keys:
M: Sort by Memory usage.P: Sort by CPU usage (returns to default).T: Sort by Running Time.N: Sort by Process ID (PID).
Try it now:
- Run
topin your terminal. - Press
Shift + m(to send an uppercase M). - Notice how the process list changes!
- Press
qwhen you want to exit.
Does that help you find what's using up your memory?