Clean buffers and cached on linux

Need root permission

# clean buffer and cached
[email protected]:~# free -m && sync && echo 3 > /proc/sys/vm/drop_caches && free -m
# step by step
total used free shared buffers cached
Mem: 3951 3260 691 0 46 121
-/+ buffers/cache: 3092 859
Swap: 4095 0 4095
[email protected]:~# echo 3 > /proc/sys/vm/drop_caches
total used free shared buffers cached
Mem: 3951 3065 886 0 2 22
-/+ buffers/cache: 3040 911
Swap: 4095 0 4095

Before:

  • buffers = 46 mb

  • cached = 121 mb

After

  • buffers = 2 mb

  • cached = 22 mb