> The next question is - can this ever be done by a non-root user? I tried 
> adding /bin/echo to /etc/sudoers, but still get an error:

I was able to google these two approaches to dropping caches over sudo:

sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"

or

echo 3 | sudo tee /proc/sys/vm/drop_caches

See the comments here: http://www.linuxinsight.com/proc_sys_vm_drop_caches.html

But as I said, in my experiments dropping caches did not help. What makes this 
hard to test is that vmcp running out of memory is not easily reproducible. It 
can happen once, then you can try rerunning for a while and it keeps happening. 
But suddenly the kernel rearranges the slabs and you can run fine for days. The 
problem is that I have not found a way to free memory for large kernel slabs 
from within a script. If you are trying to fix the problem as human, the 
solution is to repeatedly run vmcp --buffer=1M q userid and it will eventually 
go away.

Tomas

Reply via email to