You are not logged in.
Pages: 1
Have anybody experienced with something like that:
root# echo 0 > /proc/sys/vm/drop_caches
bash: echo: write error: Invalid argument
root#
This seems that after setting drop_caches to any value (the initial is 0) it cannot be restored. More strange - there is no problem to set it to 1 or 2, just 0 is invalid. Could you tell me what is wrong?
Last edited by nbvcxz (2011-09-24 14:08:06)
Lenovo G50 | LXQT-git | compton | conky
Offline
I found http://duopetalflower.blogspot.com/2009 … 8115542620 (the last comment)
Offline
drop_caches is a command, not a variable to be set,
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 not freeable, the
user should run `sync' first.
See, no 0.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Understood karol and fsckd. Thank you for help. My misunderstanding was from: https://wiki.archlinux.org/index.php/Em … pty_caches where author suggests "setting back" drop_caches to 0 (line 5). But now if I am right "0" is just initial (dummy) value and there is no need to set it back to 0.
So in script instead of:
echo 3 > /proc/sys/vm/drop_caches
echo 0 > /proc/sys/vm/drop_caches
it should be something like:
sync
sysctl -w vm.drop_caches=3
Last edited by nbvcxz (2011-09-24 19:52:08)
Lenovo G50 | LXQT-git | compton | conky
Offline
it should be something like:
sync sysctl -w vm.drop_caches=3
Yes, at least that's how I do it:
sync; sysctl -w vm.drop_caches=3
Could you please fix the wiki?
Offline
Pages: 1