Web Design

Categorized | System, cli

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 T4L

Author's web site



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


7 Comments

  1. failzo

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

    faizlo

    1
  2. anand

    log on to root and try the command

    2
  3. Tarentrulle

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

    3
  4. Nepenthic

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

    4
  5. GCXX

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

    5
  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 ?

    6
  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.

    7

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>