1.查看當(dāng)前內(nèi)存剩余
free -m
2.發(fā)現(xiàn)free剩余很少,buff/cache占用很高
3.安裝hcache查看誰(shuí)在占用
wget https://silenceshell-1255345740.cos.ap-shanghai.myqcloud.com/hcache
chmod 755 hcache && mv hcache /usr/local/bin/
hcache -top 10
3.發(fā)現(xiàn)是journal這個(gè)東西,這是linux系統(tǒng)日志,出現(xiàn)這種情況,一般是日志沒(méi)有配置好
查看配置文件
cat /etc/systemd/journald.conf
將Storage=persistent
重啟日志服務(wù)
systemctl restart systemd-journald
手動(dòng)清理緩存區(qū)文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-801671.html
echo 1 > /proc/sys/vm/drop_caches
再次free -m 查看文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-801671.html
到了這里,關(guān)于linux緩沖區(qū)(buff/cache)內(nèi)存占用過(guò)高解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!