There is a couple of different ways, but if you just want something cheap and dirty, you can create a cron job as root to run the following:
cat /proc/meminfo | grep MemFree >> /root/memfree.txt
Set it to run as often as you like.
*/5 * * * * cat /proc/meminfo | grep MemFree >> memfree.txt
would run it every 5 minutes and write it to the file memfree.txt.