4 of 11
Beatified and Canonized. Retagged a bit & gave it a new, more generic title.
  • 78020
  • 16
  • 125
  • 210

Why is Linux reporting “free” memory strangely?

This is a canonical question about how Unix operating systems report memory usage.
It aims to answer questions like "Why do I have so little free RAM?", and "What is using all the RAM on my Linux server?"

I have production server that is running Debian 6.0.6 Squeeze

#uname -a

Linux debsrv 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 GNU/Linux

Every day cron executes backup script as root:

#crontab -e

0 5 * * * /root/sites_backup.sh > /dev/null 2>&1

#nano /root/sites_backup.sh

str=`date +%Y-%m-%d-%H-%M-%S`
tar pzcf /home/backups/sites/mysite-$str.tar.gz /var/sites/mysite/public_html/www
mysqldump -u mysite -pmypass mysite | gzip -9 > /home/backups/sites/mysite-$str.sql.gz
cd /home/backups/sites/
sha512sum mysite-$str* > /home/backups/sites/mysite-$str.tar.gz.DIGESTS
cd ~

Everything works perfectly, but I notice that Munin's memory graph shows increase of cache and buffers after backup.

Then I just download backup files and delete them. After deletion Munin's memory graph returns cache and buffers to the state that was before backup.

Here's Munin graph:

Unfortunately I don't have enough rep to add image here. So here's a link: munin graph http://img19.imageshack.us/img19/2794/muningraph.png