Clear cache, buffer and Swap in Linux

Clear cache, buffer and Swap in Linux

How to Clear cache, buffer and Swap in Linux.

as you know any operating system to performance its processes and  also increase operating speed of system use from cache, buffer & ….

Linux is no exception and maybe it can be said that it uses this subject much better than other operating system. Accordingly to manage and clear the cache,  buffer and swap in lunix, provide a solution for your users to delete if needed.

Now In this article, we are going to teach commands and a solutions for clearing cache, buffer and swap in Linux use them if you need or fill the RAM and slow down the system to empty more space in the RAM.

Recommended Article: How to install Nmap on Linux


Follow us on how to clear memory cache, buffer and swap in Linux.

Clear memory cache, buffer and swap in Linux

There are three ways to remove cache, buffer, etc., which are:

1) To delete only PageCache, you can enter the following command :

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

2) Now if you need to delete Dentries and Inodes created , you must enter the command:

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

3) Finally, if you consider to delete all page Cache, Dentries, and Indoes, you must enter the command as follows:

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

In this way you are familiar with the function of the Sync command and From now on, you can use it to clear the cache.

Finally, it is worth noting that you can use this command at certain times and when a Linux server has not been restarted for a long time.

Repeated use of this command may interrupt the performance of Linux and run kernel processes, so avoid using it continuously.

You can also use this command in Cron to automatically clear, after 24 or 48 hours of high pressure on the server.

At the end We hope you enjoy using of this article to clearing memory cache, buffer and swap in linux.

If you have any questions or problems, you can ask the Ask system to provide guidance.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

    Leave Your Comment

    Your email address will not be published.

    We are by your side every step of the way

    Think about developing your online business; We will protect it compassionately

    We are by your side every step of the way


    7 days a week, 24 hours a day