Advanced

How to Clear Memory Cache on Linux

Posted by zinoune on · 2 comments
Unixmen
Mail this story
Print this story

By default, every Linux OS has an efficient memory management system used to clear the buffer cache periodically.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (2)

nmset ·
I am well aware this is not a technical forum but one aspect of this writing troubles me. While there may be circumstances when the system cache should be cleared (testing purposes mainly), I can't see why would one do this in a cron job, because it obviously results in huge performance drop, nearly insulting to all the work that has been done to maximize performance.

Also, drop_caches should be reset back to zero after testing. I could not find any info whether setting drop_caches to 3 only clears the cache, or whether it clears and disables it altogether. Any knowledgeable forum reader ? Thx.
gus3 ·
Writing to drop_caches is a single-shot action, and then the cache starts re-filling. There are other tunables to alter ongoing behavior of the caching system.

For my own testing, I prefer to just dirty the caches with a single, un-measured run, followed by how ever many measured runs I need, with no cache-clearing in between.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post