Web Design

Categorized | cli, System

Tags : ,

Clear the memory cache in Linux

In Linux, you can clear the cache of the memory by using

sync; echo 3 > /proc/sys/vm/drop_caches

Author Profile

T4L ;

Other posts by

Author's web site

Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


  1. failzo

    How to do that with Ubuntu? I tried it with sudo, but it keeps saying Permission is needed.


  2. anand

    log on to root and try the command

  3. Tarentrulle

    or try sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"

  4. Nepenthic

    Just wanted to say thanks been trying to do that all morning.

  5. GCXX

    just want to thanks to Tarentrulle
    sudo sh -c “sync; echo 3 > /proc/sys/vm/drop_caches”
    saved my life!

  6. vga over cat5

    I have test and working successfully on debian6. But I wonder if its a good habit to use on a daily cron on my vps has limited memory on it.

    My vps has 512mb memory so I wonder does this function help to use my memory efficiently.

    What do you think about it ?

  7. Lars R.

    @vga over cat5: It is completely useless to flush the block cache on Linux.

    The Kernel wipes unecessary entries as soon as it needs memory for other purposes. Until them the chaces are kept. Unused RAM is just useless.

  8. Nnitesh

    Thanks a tonn sir, sync; echo 3 > /proc/sys/vm/drop_caches

    This command helped me a lot.
    Cleared cached memory from 2GB to 500mb.. Excellent.


  9. xibjulous

    ok this made no sense at all for me what do i type it into a word document or what??


1 Trackback(s)

  1. 21 02 2009 : Clear memory cache to speed up your box « Linux & Stuff

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>