My system grinds to a halt when physical RAM fills up. The problem is that I have a swap partition and swappiness is set to 60 but the swap is barely being used.
$ cat /proc/sys/vm/swappiness 60 $ free total used free shared buff/cache available Mem: 16316280 12921308 160164 1131864 3234808 1942056 Swap: 16666108 399872 16266236
As you can see I am dangerously close to being out of memory, about 80%. I compiled some source and it hit 98%, my system started to stutter heavily but I was able to kill it before it hit 100%. In the past if I'd allowed it to keep going and reach 100% my system would've completely locked up and not recover even if left for hours; magic SysRq key to trigger OOM did nothing.
Unlike other problems I've seen posted (complaining that swap is not being used at all), swap is being used by my system, just not very much, it never exceeds 3%, and the result is that my system gets slow or hangs as physical memory fills up. A few hundred MB will get swapped when physical RAM is near 100% but that's it, and then it locks up.
Ideally it would be swapping out well before hitting my cap to mitigate that. I tried setting swappiness to 100 but it didn't help much: swap usage reached 4% even as my physically RAM touched 99%
My workaround is to pretend I don't have any swap and kill Chromium every few days as it slowly eats up gigabytes of memory, and admittedly that's probably a good thing to do regardless, but that just hides the fact that my swap space is not being optimally used.
I'm going to kill Chromium now so I can finish my build. It'll take about a week to consume this amount of memory again so if anyone has any suggestions I'll be able to try them then.