清linux缓存,完全清空需要root

dspeak@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar$ cat /proc/sys/vm/drop_caches

3

dspeak@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar$

dspeak@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar$ echo 3 > /proc/sys/vm/drop_caches

-bash: /proc/sys/vm/drop_caches: Permission denied

dspeak@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar$ free -m

total used free shared buffers cached

Mem: 1011 626 385 0 88 444

-/+ buffers/cache: 92 918

Swap: 1357 2 1354

dspeak@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar$ sudo -s

[sudo] password for dspeak:

Sorry, try again.

[sudo] password for dspeak:

root@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar# free -m

total used free shared buffers cached

Mem: 1011 627 383 0 88 444

-/+ buffers/cache: 94 916

Swap: 1357 2 1354

root@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar# echo 3 > /proc/sys/vm/drop_caches

root@lm-vm01:~/luowl/soft/lucene-3.0.1/demo-jar# free -m

total used free shared buffers cached

Mem: 1011 29 981 0 0 4

-/+ buffers/cache: 25 985

Swap: 1357 2 1354

你可能感兴趣的:(linux,cache,Lucene,bash)