I had a very strange WTF-moment yesterday, when I noticed that one of our servers had hogged most of the momery – almost 3 gigs – to linux kernel cache, which meant that the appserver had only a tiny fraction of memory to start on with, and ran quite fast into problems with starting new threads etc. Happy times to no-one.
As I hadn’t ever before had similar experience of seeing almost all the memory taken by no process, but the kernel itself, I was little worried. Luckily Google helped me to find info on how to drop linux caches:
So effectively running as root:
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
.. dropped caches and appserver was free to start again.
Live and learn.