List Top Memory consuming processes in Linux


The following command can be used to list the most memory consuming processes in Linux:

ps axo rss,comm,pid | awk ‘{ proc_list[$2] += $1; } END \
{ for (proc in proc_list) { printf(«%d\t%s\n», proc_list[proc],proc); }}’ \
| sort -n | tail -n 10 | sort -rn | awk ‘{$1/=1024;printf «%.0fMB\t»,$1}{print $2}’

Share Button

Leave a Reply

You must be logged in to post a comment.