Find what is consuming more memory in linux
ps axu | awk '{print $2, $3, $4, $11}' | head -1 && ps axu | awk '{print $2, $3, $4, $11}' | sort -k3 -nr |head -5
The result is here
PID %CPU %MEM COMMAND 2222 3.2 3.8 /usr/lib/firefox/firefox 1937 0.2 1.5 /home/sorin/.dropbox-dist/dropbox 1073 3.8 1.0 /usr/bin/X 2407 0.2 0.9 pidgin 4105 1.5 0.8 /usr/lib/firefox/plugin-container
I see the 5 processes which consume most of the memory.
If I want to see the CPU, then I sort after second column => sort -k2
ps axu | awk '{print $2, $3, $4, $11}' | head -1 && ps axu | awk '{print $2, $3, $4, $11}' | sort -k2 -nr |head -5
outputs:
PID %CPU %MEM COMMAND 3448 16.9 0.2 rsync 1073 3.7 1.0 /usr/bin/X 2222 3.2 3.7 /usr/lib/firefox/firefox 830 2.5 0.5 /sbin/mount.ntfs 4105 1.4 0.6 /usr/lib/firefox/plugin-container
Leave A Comment