Is there a tool that allows logging of memory usage?

Occasionally when the need arises I just do:

$ top -d 1 -b |grep <process> >>somefile

It's not an elegant solution, but gets the job done if you want the quick crude value to verify your hypothesis.


I have written a script to do exactly this. It basically samples ps at specific intervals, to build up a profile of a particular process. The process can be launched by the monitoring tool itself, or it can be an independent process (specified by pid or command pattern).


sar (System Activity Reporter) from the sysstat package is your friend in case like these.

Another way would be monitoring combined with historical data, e.g. Munin, pnp4nagios, rrdtools, ...