linux下释放内存缓存

vi Cached.sh

编写shell脚本

   #! /bin/bash  
    # cache释放:  
    # To free pagecache:  
    sync  
    sync  
    #echo 1 > /proc/sys/vm/drop_caches  
    # To free dentries and inodes:  
    #echo 2 > /proc/sys/vm/drop_caches  
    # To free pagecache, dentries and inodes:  
    echo 3 > /proc/sys/vm/drop_caches 

然后保存

crontab -e

编写定时任务执行

原文地址:https://www.cnblogs.com/xuexin/p/6603605.html