How to Clear RAM Memory Cache, Buffer and Swap Space on Linux

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

84 Responses

  1. Makler says:

    su -c "echo 3 >'/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'" root

    Is there a password for this after hitting enter ??? if not why does it ask me?

    and could this be applied for the home desktops too ???

  2. mainmeat says:

    You might want to correct

    swapoff -a && swapon -a
    

    to

    sudo swapoff -a && sudo swapon -a
    
  3. Miphix says:

    When are we going to stop talking about cron, and start talking about systemd timers? It’s time, guys.

    • KPPL says:

      Well, not everybody is in love with systemd.

    • Yoandre Valdes Rodriguez says:

      If you are in love with systemd OK go ahead and use timers but don’t pretend that every body is agree with you.

      • Lucas Ramage says:

        Exactly! I literally went out of my way to comment specifically on this. Why does systemd even need a timer? It’s _supposed_ to be an init system.

    • TW says:

      When are we going to stop talking about systemd and move to openRC? It’s time, guys. Long, long past time in fact.

  4. karthik sailendra says:

    What is the tool you used to generate the Screenshot Gif

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.