问题原文
原帖链接 · ivcode · CC BY-SA 3.0
In our servers we have a habit of dropping caches at midnight.
sync; echo 3 > /proc/sys/vm/drop_caches
When I run the code it seems to free up lots of RAM, but do I really need to do that. Isn't free RAM a waste?
社区高分解答
原帖链接 · ananthan · CC BY-SA 3.0
Yes, clearing cache will free RAM, but it causes the kernel to look for files on the disk rather than in the cache which can cause performance issues.
Normally the kernel will clear the cache when the available RAM is depleted. It frequently writes dirtied content to disk using pdflush.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
