linux释放内存脚本

原文链接: https://yq.aliyun.com/articles/233208
#!/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

你可能感兴趣的:(linux释放内存脚本)