0

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.

  • Is Mozilla Firefox an option? Maybe it will not eat the ram as Chromium does. – Level_Up Mar 11 at 16:57
  • It is, but that's still only masking the issue, and from past experience it eventually is the same anyway, consuming many GB of RAM until there's none left and it needs to be culled, it just takes longer. Lots of different browsers I could use instead; doesn't explain why I run out of physical RAM with only 3% swap used. – WizardStan Mar 11 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.