This commit is contained in:
26
Docs/Linux清理缓存.md
Normal file
26
Docs/Linux清理缓存.md
Normal file
@@ -0,0 +1,26 @@
|
||||
> 本文作者:丁辉
|
||||
|
||||
# Linux清理缓存
|
||||
|
||||
Linux 系统有三种选项来清除缓存而不需要中断任何进程或服务。
|
||||
|
||||
> 译注:Cache,译作“缓存”,指 CPU 和内存之间高速缓存。Buffer,译作“缓冲区”,指在写入磁盘前的存储再内存中的内容。在本文中,Buffer 和 Cache 有时候会通指。)
|
||||
|
||||
- 仅清除页面缓存(PageCache)
|
||||
|
||||
```bash
|
||||
sync; echo 1 > /proc/sys/vm/drop_caches
|
||||
```
|
||||
|
||||
- 清除目录项和inode
|
||||
|
||||
```bash
|
||||
sync; echo 2 > /proc/sys/vm/drop_caches
|
||||
```
|
||||
|
||||
- 清除页面缓存,目录项和inode
|
||||
|
||||
```bash
|
||||
sync; echo 3 > /proc/sys/vm/drop_caches
|
||||
```
|
||||
|
Reference in New Issue
Block a user