pmem is a small command line utility for all Linux und Unix operating systems to display memory information of running processes
To install pmem just untar the source package and run make. This will create the binary pmem-1.1.2. Run configure, make and finally make install to install the binary in /urs/local. You can also set another installation directory by calling configure with the option --prefix=/foo/bar.
Summary of the installation process:
1. tar xzf pmem-version.tar.gz
2. cd pmem-version
3. ./configure [--prefix=...]
4. make install
pmem must be called with one or more process ids of the processes for which the memory usage should be display. By default pmem displays the resident memory of the process in bytes. But the behaviour of pmem can be influenced by the following arguments:
-z displays the size
-s displays the shared memory
-k displays the memory usage in kilobytes
-m displays the memory usage in megabytes
-d displays all memory information available
-l log memory usage of given pids
-i log interval in milliseconds [default: 100]
-g write a gnuplot command file into plot.gnu
-h displays the help
-v displays the version
On success pmem returns with the exit code 0, otherwise 1.
To log the memory usage of a process and create a gnuplot file out of the data:
./pmem -l pids -i 100 -g data >data
gnuplot plot.gnu (creates the graph plot).