Memory Tuning

Enabling swap partition;

/dev/sda3 swap swap defaults 0 0

Write data and drop page cache, dentries and inodes

sync
echo 3 > /proc/sys/vm/drop_caches

Adjusting memory cache ratios:

# Page out applications as little as possible
sysctl -w vm.swappiness=1
echo "vm.swappiness=1" >> /etc/sysctl.conf
# or
# echo 0 > /proc/sys/vm/swappiness
# Favour inode/dentry cache instead of block cache
sysctl -w vm.vfs_cache_pressure=50

Ref: http://www.kernel.org/doc/Documentation/sysctl/vm.txt