How to Delete Buffers and Cache Memory in Linux

Step 1: Check Buffers & Cache Memory

To check the buffers and cache memory in linux, execute the following command:

# free
              total        used        free      shared  buff/cache   available
Mem:        1015944      211640       94724       57700      709580      562416
Swap:             0           0           0

Step 2: Check Buffers & Cache Memory

Now delete and check the buffers and cache memory it will be reduced:

# sync && echo 3 > /proc/sys/vm/drop_caches && free

Following are the Linux Kernal that how can we drop the various aspects of cached items by changing the numeric argument to the above command
To free pagecache:

# echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

# echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

# echo 3 > /proc/sys/vm/drop_caches
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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

three × 3 =