Saturday, May 18, 2024
Centos Debian Ubuntu

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

Every Linux System has three options to clear cache without interrupting any processes or services.

1. Clear PageCache only.

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

2. Clear dentries and inodes.

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

3. Clear PageCache, dentries and inodes.

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

If you want to clear Swap space, you may like to run the below command.

# swapoff -a && swapon -a
(Visited 213 times, 1 visits today)
Baca Juga :  Cara Install VLC Media Player pada Ubuntu 20.04 / Debian 11 / Linux Mint

Similar Posts