What is it?

Dispmem is a small and simple program to repeatedly display system wide memory usage (similar to free). What makes dispmem different is that it also displays changes of usage and is more suitable for graphing. There is also a C version of the same program (which behaves better in error conditions) which was done to compare the development effort between python and C. No surprises here really (check the README below).

First example where swap is disabled while system is doing normal desktop tasks (amarok playing music over NFS).

Second example where swap has been re-enabled and gcc is compiling one C file which contains about 8 megabytes of static structures. GCC is a memory hog (as you can see).


Contents of README


dispmem is a simple program to display memory usage and change of memory
usage over time. the metric data is taken from /proc/meminfo (which means
that Linux is required).

there are two implementations of dispmem, both which do exactly the same
thing. Why? As a mental exercise it was instructive to reimplement the
same program in C (after the python version) in order to compare the
required code amount and development effort.

The python version is shorter and took about 15 minutes to write and test.
The C version is quite a bit longer and took about 1 hour to write and test,
where testing took majority of the time.

Cleaning up/writing this blurb and copyright notices took another hour.

For a more featureful program you should check out dstat which is a measurement
program for various data and outputs the data in colors. For my use, dstat
wasn't suitable since it doesn't display delta and also displays usage
in megabytes (because of automatic unit scaling which cannot be disabled).
Besides this, dstat leaks memory (on my systems) so it is not suitable for
long runs. It is a nice piece of software though.

Display units are kibibytes (1024 bytes). Default sleep time between
displaying new lines is 1 second. There are no command line switches,
if you want to modify something, you'll have to change the source.

Aleksandr Koltsoff (czr@iki.fi)


2006-11-29 1.0 * Release

2006-11-29 1.0.1 The time-machine edition
- Added support for older pythons (1.5.2 oldest tested)
- Added support for 2.2/2.4 kernel meminfo


Select a suitable version here.