Linux system clears memory cache and swap
in Note with 0 comment
Linux system clears memory cache and swap
in Note with 0 comment

Clear memory cache

There are three levels

 # 1: clear the 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

be careful:

  1. It needs to be executed under the root account
  2. among sync The purpose of the command is to flush the file system buffer

Clear swap

 sudo swapoff -a && sudo swapon -a
Responses