Linux Administrator

How To Find Top 10 Memory Consuming Process In Linux/Ubuntu

Written by Santosh Prasad

In this article I will show you how you can find the top 10 memory consuming process in Linux. As a system admin you always need to know which process is taking how much memory in Linux and Ubuntu. Follow the below command to display the memory usage per process in Linux terminal.

Find Top 10 Memory Consuming Process

# ps -eo pmem,pcpu,pid,args | tail -n +2 | sort -rnk 1 | head

Below is the output of the command:

 1.7  1.9 26318 /usr/sbin/httpd.worker
 1.5  1.9 27406 /usr/sbin/httpd.worker
 0.5  0.0 17937 memcached -d -p 11211 -u memcached -m 1024 -c 1024 -P /var/run/memcached/ -s /var/run/memcached/memcached.sock -a 0666
 0.2  0.0 17971 /usr/sbin/httpd.worker
 0.1  0.1  3389 /usr/bin/blackfire-agent --log-file=/var/log/blackfire/agent.log --socket=unix:///var/run/blackfire/agent.sock
 0.0  0.0 31962 /sbin/rsyslogd -i /var/run/ -m 0
 0.0  0.0 31940 portmap
 0.0  0.0 31918 /bin/sh /usr/local/bin/ /var/www/chroot/
 0.0  0.0 31917 inotifywait -mrq -e CREATE --format %w%f --exclude .*/tmp /var/www/chroot/
 0.0  0.0 31916 /bin/sh /usr/local/bin/ /var/www/chroot/

Field Explanations:

ps : Current process snapshot report
e : Select all process
o : User defined format
pmem : User defined memory
pcpu : User defined cpu
pid : Process ID number
args : Command
tail -n +2 : Output lines starting to the second line
sort -rnk 1 :reverse (r), numeric sort (n) by column 1 (memory)
head : output the 10 first lines

I hope this article will help to find the top 10 memory consuming process in Linux. If do you have any alternate please share with us.


Thank you! for visiting Look Linux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment