NotePublic/Software/System/Linux/Common/Linux_释放缓存空间.md

20 lines
407 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Linux 释放缓存空间
Linux 下释放 cache 空间命令如下:
```bash
# 在释放缓存前应该先
sync
# 手动释放内存
echo 3 > /proc/sys/vm/drop_caches
# 查看内存是否已经释放
free -h
```
drop_caches 的值可以是 0-3 之间的数字,代表不同的含义:
- 0不释放系统默认值
- 1释放页缓存
- 2释放dentries和inodes
- 3释放所有缓存