/proc/sys/vm/swappiness == 0 makes OOM killer go beserk
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · you
the OOM killer just killed some of my processes while the system still had >2.5 GB of free swap. I'm running vanilla 2.6.15 on my desktop. The machine is a single Athlon64, 1 GB RAM, 3 GB swap,
x86_64kernel, (mostly) i386 userland. A few days ago I have set/proc/sys/vm/swappinessto 0 to see whether it would increase the interactive performance.
I have to say I've noticed the same thing.
On my home workstation I do a lot of stuff with very large video files, so set swappiness to 0 some time ago so using these large files would stop all the applications getting pushed out into swap.
However I've noticed that ocassionally the kernel has killed large memory processes (eg firefox!) even when there was lots of swap free.
Recently, I found I just could not use gimp to edit a very large image (about 800MB on a 1 GB machine) without the OOM killer killing it. When I reset swappiness to 60 I could then use gimp fine.
This doesn't seem like correct behaviour to me! (Though I note the caveat I read somewhere that swappiness probably doesn't do what I think it does - it probably doesn't!)
Signature · 1 line
Nick Craig-Wood <[email protected]> -- http://www.craig-wood.com/nick
Quoted 3 lines · Nick Craig-Wood
On my home workstation I do a lot of stuff with very large video files, so set swappiness to 0 some time ago so using these large files would stop all the applications getting pushed out into swap.
My motivation was similar: My desktop usually runs 24 hrs and I leave large applications which I use from time to time always open. Like OpenOffice, Firefox, Emacs with large buffers, etc. In the night, the machine performs two disk-intensive tasks. First a backup then updatedb. And every morning about 650 MB of 1 GB RAM is used for caches and all my application need to be swapped in before I can use them.
Of course, the increase of disk cache is reasonable for those tasks, but honestly, I don't care whether the updatedb process takes 10 or 20 minutes in the night. But I do care if switching between applications needs >10 seconds in the morning.
Would it be possible to trigger paging in specific applications from userspace? So I might run something like
echo -n firefox-bin > /proc/sys/vm/page-in
echo -n soffice-bin > /proc/sys/vm/page-in
...
after my nightly cron jobs have filled the memory with disk cache data that won't be useful anymore, because in my daily work I rarely touch 10% of the filesystem.
Regards,
Jim
Quoted 19 lines · Jim MacBaine
Quoted 3 lines · Nick Craig-Wood
On my home workstation I do a lot of stuff with very large video files, so set swappiness to 0 some time ago so using these large files would stop all the applications getting pushed out into swap.
My motivation was similar: My desktop usually runs 24 hrs and I leave large applications which I use from time to time always open. Like OpenOffice, Firefox, Emacs with large buffers, etc. In the night, the machine performs two disk-intensive tasks. First a backup then updatedb. And every morning about 650 MB of 1 GB RAM is used for caches and all my application need to be swapped in before I can use them.
Of course, the increase of disk cache is reasonable for those tasks, but honestly, I don't care whether the updatedb process takes 10 or 20 minutes in the night. But I do care if switching between applications needs >10 seconds in the morning.
Quoted 6 lines
Would it be possible to trigger paging in specific applications from userspace? So I might run something like
echo -n firefox-bin >
/proc/sys/vm/page-in
echo -n soffice-bin >/proc/sys/vm/page-in
...
Crude, but may work:
swapoff -a
swapon -a
Quoted 3 lines
after my nightly cron jobs have filled the memory with disk cache data that won't be useful anymore, because in my daily work I rarely touch 10% of the filesystem.
--
vda