Brain Goo

Carpe Crap ’em

Brain Goo header image 2

 

 

HOW TO Flush The Linux File Cache

May 19th, 2014 · No Comments

You can’t prevent Linux from using the file cache and you don’t want to. However, on occasion you may want to flush it. Here’s how:

First, flush your filesystems to disk. Just run the command sync

Then, echo 1, 2 or 3 in to /proc/sys/vm/drop_caches. It breaks down like this:

  1. free pagecache: echo 1 > /proc/sys/vm/drop_caches
  2. free dentries and inodes: echo 2 > /proc/sys/vm/drop_caches
  3. free pagecache, dentries and inodes: echo 3 > /proc/sys/vm/drop_caches

Did you find this post useful or have questions or comments? Please let me know!

Tags: How Tos · linux

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment