Memory Usage Monitoring – Applications to Show Memory Usage Similar to Top

command linememory usagemonitoringsoftware-recommendation

I would like to leave an application running in my terminal that shows me the memory usage, similar to how top shows CPU and other info, and iotop shows the top I/O users.

Top and iotop

Does such an application exist?

P.S. I know top shows memory usage as well, but I'm talking about sorting by top memory usage and not showing any other info (similar to what iotop does).

Best Answer

The closest I could find is memtop, a Python script available here on Google Code.

Screenshot: enter image description here

How to use memtop

  • It's a Python script, so simply do a sudo mv memtop-1.0.0.py /usr/bin/memtop.py and a chmod +x /path/to/memtop.py to make it executable
  • Default update period is 15 min; use switch -p 1 to make it 1 minute, etc. (can't go lower than that unless you modify the source)
  • Use -l N, where N is the number of processes you want to show, depending on the size of your terminal.
  • Use -m to show "more" information, i.e. the Swap/Page stats at the bottom of the screenshot.

The htop disguised as memtop option

If you don't use htop otherwise, it's pretty easy to set it up with the F2-setup option to look like memtop:

enter image description here

  • htop config is stored in ~/.config/htop/htoprc, so just delete htoprc to restore normal htop.