如何释放linux cache占用的内存

Posted 卡卡西村长的小灶

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何释放linux cache占用的内存相关的知识,希望对你有一定的参考价值。

[[email protected] ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3792       3663        128        184        148       3003
-/+ buffers/cache:        511       3280
Swap:            0          0          0

[[email protected] ~]#  cat /proc/sys/vm/drop_caches
0

[[email protected] ~]# sync

[[email protected] ~]# echo 3 > /proc/sys/vm/drop_caches
[[email protected] ~]#  cat /proc/sys/vm/drop_caches
3

[[email protected] ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3792        395       3397        184          2         19
-/+ buffers/cache:        372       3419
Swap:            0          0          0

 

以上是关于如何释放linux cache占用的内存的主要内容,如果未能解决你的问题,请参考以下文章

linux cached内存过大

buff/cache占用太多内存,如何释放内存?

linux内存占用率过高怎么办

free命令-linux内存cached释放

Linux [buff/cache]内存缓存占用过高分析和优化

已解决Linux中buff/cache(磁盘写/读缓存)占用大量内存导致用户进程内存不足