You have a Linux box. It has RAM. You'd like to log and monitor memory usage. You have many options -- here's one: use a check_mem plugin for Nagios, but use it stand-alone at first. You'll have detailed memory logging in just a minute, and will take your first step toward full system monitoring with Nagios (later when you can formally install the plugin).
Download: https://raw.github.com/justintime/nagios-plugins/master/check_mem/check_mem.pl
Read it and make sure you feel comfortable running it. Then chmod a+x check_mem.pl
and see help with ./check_mem.pl -h
. In one shell, run it in a 5s loop, logging to /tmp/mem.log (Control-C to stop):