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 ~") }'
0 comments:
Post a Comment