定时释放Linux/CentOS缓存
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/bash used = `free - m | awk 'NR==2' | awk '{print $3}' ` free = `free - m | awk 'NR==2' | awk '{print $4}' ` echo "===========================" >> yl_dropcaches.log date >> yl_dropcaches.log echo "Memory usage | [Use:${used}MB][Free:${free}MB]" >> yl_dropcaches.log # drop caches when the free memory less than 10G if [ $free - le 10000 ] ; then #sync && echo 1 > /proc/sys/vm/drop_caches #sync && echo 2 > /proc/sys/vm/drop_caches sync && echo 3 > / proc / sys / vm / drop_caches echo "OK" >> yl_dropcaches.log else echo "Not required" >> yl_dropcaches.log fi |
https://www.cnblogs.com/zxc2man/p/8175952.html
https://blog.csdn.net/e_wsq/article/details/79905221
https://blog.csdn.net/jfb53440/article/details/79171941
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步