With the use of tools such as valgrind's cachegrind and perf I was able to work on some of the code hot-spots [2] and reduce it from ~50-60% CPU down to 5-9% CPU utilisation on my laptop, so it's definitely more machine friendly now. In addition I've added the following small features:
- Now one can specify the name of a process to monitor as well as the PID. This also allows one to run pagemon on itself(!), which is a bit meta.
- Perf events showing Page Faults and Kernel Page Allocates and Frees, toggled on/off with the 'p' key.
- Improved and snappier clean up and exit when a monitored process exits.
- Far more efficient page map reading and rendering.
- Out of Memory (OOM) scores added to VM statistics window.
- Process activity (busy, sleeping, etc) to VM statistics window.
- Zoom mode min/max with '[' (min) and ']' (max) keys.
- Close pop-up windows with key 'c'.
- Improved handling of rapid map expansion and shrinking.
- Jump to end of map using 'End' key.
- Improve the man page.
Version 0.01.08 should be hitting the Ubuntu 16.04 Xenial Xerus archive in the next 24 hours or so. I have also the lastest version in my PPA (ppa:colin-king/pagemon) built for Trusty, Vivid, Wily and Xenial.
Pagemon is useful for spotting unexpected memory activity and it is just interesting watching the behaviour memory hungry processes such as web-browsers and Virtual Machines.
Notes:
[1] Mainly very late at night when I can't sleep (but that's another story...). The git log says it all.
[2] Reading in /proc/$PID/maps and efficiently reading per page data from /proc/$PID/pagemap