Linux Administrator

How to:- Find Top 10 Memory Consuming Process in Linux/Debian

In this article I will show you how you can find 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.

You may also like : How to Find Top 10 CPU Consuming Process in Linux?

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/memcached.pid -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/rsyslogd.pid -m 0
 0.0  0.0 31940 portmap
 0.0  0.0 31918 /bin/sh /usr/local/bin/inotifywait.sh /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/inotifywait.sh /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.

Thanks:)

Thank you! for visiting LookLinux.

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

About the author

mm

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