Menu

Linux – Top memory usage by process

Here are a couple of commands to help find top memory wasters.

Process – Sorted by occupied memory(2 column)1
ps -e -orss=,pid=,args= | sort -nr | head|awk '{print $2"\t"$1/1024"\tMB\t"$3;}'
Method 2
cat /proc/meminfo |grep MemTotal
echo ' ' | awk '{ system("cat /proc/meminfo |grep MemTotal") }'
totalmem=$(cat /proc/meminfo |grep MemTotal | awk '{print $2}');
 
ps -e -orss=,pid=,args= | sort -nr | head|awk '{print $2"\t"$1/1024"\t"$3"\t"$totalmem;}'
Disk Usage
sudo du -hx --max-depth=2 / |egrep "^[0-9\.]+G"
 
# show home directory
echo ' ' | awk '{ system("ls -la ~") }'

About Author:


I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Next
Newer Post
Previous
Older Post

0 comments:

Post a Comment

 
Top