1. cat /proc/sys/vm/drop_caches

默认返回0


drop_caches详细文档

Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free.
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
As this is a non-destructive operation, and dirty objects are notfreeable, the user should run "sync" first in order to make sure allcached objects are freed.
This tunable was added in 2.6.16.

2. free -m 

手工释放linux buff/cache内存_linux



3. sync

sync 命令将所有未写的系统缓冲区写到磁盘中


4. echo 3 > /proc/sys/vm/drop_caches

5. cat /proc/sys/vm/drop_caches

手工释放linux buff/cache内存_linux_02


6. free -m 

手工释放linux buff/cache内存_linux_03