#!/bin/bash
freemem=$(cat /proc/meminfo | grep "MemFree" | awk '{print $2}')
if [ $freemem -le 23500000 ];then
date >> /tmp/mem.log
free -m >> /tmp/mem.log
sync
sync
echo 3 > /proc/sys/vm/drop_caches
free -m >> /tmp/mem.log
fi