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.


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

    Thanks

    8
  9. xibjulous

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

    9

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>