Linux – top 10 memory consuming processes

*Show top 10 memory consuming processes in descending order –

[daniel@kauai demo]$  ps havx | awk ' { print $8 " " $10}' | sort -nr  |head  -10
2267936 /usr/libexec/qemu-kvm
841588 /usr/libexec/qemu-kvm
400336 /opt/google/chrome/chrome
316424 /opt/google/chrome/chrome
299740 /opt/google/chrome/chrome
45640 /usr/bin/python
43748 /usr/sbin/named-sdb
39516 /usr/bin/Xorg
31724 libvirtd
24080 /usr/libexec/mysqld


*Continuously show top 10 every one second – Use Ctrl+C to stop.

[daniel@kauai demo]$ while (true); do ps havx | awk ' { print $8 " " $10}' | sort -nr  |head  -10; echo "..... " ; sleep 1 ; done
2267936 /usr/libexec/qemu-kvm
841540 /usr/libexec/qemu-kvm
401500 /opt/google/chrome/chrome
316360 /opt/google/chrome/chrome
300060 /opt/google/chrome/chrome
45640 /usr/bin/python
43748 /usr/sbin/named-sdb
39516 /usr/bin/Xorg
31724 libvirtd
24080 /usr/libexec/mysqld

..... 
2267936 /usr/libexec/qemu-kvm
841540 /usr/libexec/qemu-kvm
401500 /opt/google/chrome/chrome
316360 /opt/google/chrome/chrome
300060 /opt/google/chrome/chrome
45640 /usr/bin/python
43748 /usr/sbin/named-sdb
39516 /usr/bin/Xorg
31724 libvirtd
24080 /usr/libexec/mysqld

..... 
2267936 /usr/libexec/qemu-kvm
841540 /usr/libexec/qemu-kvm
401516 /opt/google/chrome/chrome
316360 /opt/google/chrome/chrome
300060 /opt/google/chrome/chrome
45640 /usr/bin/python
43748 /usr/sbin/named-sdb
39516 /usr/bin/Xorg
31724 libvirtd
24080 /usr/libexec/mysqld

..... 
2267936 /usr/libexec/qemu-kvm
841540 /usr/libexec/qemu-kvm
401528 /opt/google/chrome/chrome
316360 /opt/google/chrome/chrome
300060 /opt/google/chrome/chrome
43748 /usr/sbin/named-sdb
39516 /usr/bin/Xorg
31724 libvirtd
24080 /usr/libexec/mysqld
21260 gnome-terminal

..... 
^C
[daniel@kauai demo]$