質問

I have the following shell script that I've been using in previous versions of Ubuntu (<= 11.04) to clear memory cache and it has worked fine:

sudo sync && sudo sysctl -w vm.drop_caches=3 && sudo sysctl -w vm.drop_caches=0

I have a new clean install of 11.10 with 3.0.0-12-generic kernel and I get the following error when running the same script script:

vm.drop_caches = 3

error: "Invalid argument" setting key "vm.drop_caches"

役に立ちましたか?

解決

Documentation/sysctl/vm.txt:

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

You can't setting this to zero.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top