1

The problem I'm describing has followed me from Mint 18.3 to Devuan ASCII (~= Debian Stretch), so it is likely not super-specific to a distribution.

My typical desktop session has an IDE, two browsers (FF and Chromium), Libreoffice, a terminal application, and Thunderbird - on Cinnamon Fallback mode (it's in fallback mode because it doesn't like the fact that I don't use my discrete nVIDIA card for display but the onboard Intel graphics, yet I need the nVIDIA drivers loaded to do compute). Anyway, this ensemble works well enough, but at some point, trouble starts:

It always begins with Firefox becomes super-sluggish. I can barely switch to another app, and it can take me a minute or more to actually bring a terminal up to see what's going on. htop tells me it's at 100% CPU usage. This is already 2 problems: Why 100% even when it's not doing anything in particular? And why is the rest of the desktop not responding, even if FF wants to use up all of the CPU? Next, I kill it: killall -KILL firefox-esr. No, killing with SIGHUP doesn't work. At this point, I think theres a lot of thrashing to disk going on, but I can't verify that.

So, after it's dead, the CPU usage percentages go down, but all the apps behave as though they're climbing up a very steep slope and themselves become slow, or rather - there are delays for doing almost anything, and then that action continues at reasonable speed; until you hist some other delay, then you wait and so on. The incredible thing is, that can happen hours after the killing-of-firefox. And the sense is that somehow the system doesn't quite recover from the ordeal.

In some extreme cases, I can't manage to get the terminal window at all to do some killing, and the system effectively hangs, so I need to reboot (!) it, or log in remotely (!) to reset it.

My question: How the hell do I "unpack" this problem to try to address it or circumvent it?

Notes and additional information:

  • My system is reasonably beefy: i5 7600K, 16 GB of memory. My root partition is on a Samsung 840 SSD.
  • Most probably there is some memory leak in firefox (perhaps in some extension or plugin?) and it eats all ram then starts swapping. When you kill firefox other applications are already swapped, so it takes time for linux to bring them back to ram, and it does this only when requested (i.e. you do something with them). – jimmij Feb 18 at 10:13
  • @jimmij: 1. Buy why does the system let all of the other apps' memory get swapped out? 2. Why, when firefox is killed, don't the all get swapped in, so that even long after it's gone I get the slow-down? Is it lazily swapping in even if occasionnaly idle? 3. Can I change this lazy swap-in behavior? 4. Can I can FF's memory and CPU use? 4. Why is the desktop not responding, even if other apps are swapped out? – einpoklum Feb 18 at 10:39
  • 1
    1. Everything gets swapped to make room for firefox. 2. Because that is how linux works: there is no need to immediately bring back everything from disk to ram when it is not needed... When this slowness happens check with free what is going on with memory. And to test try removing all extensions from firefox and clear the cache. – jimmij Feb 18 at 11:06
  • 1. Why? Other apps are also working (background or foreground) 2. I didn't say immediately... what about within an hour? But free is a nice utility, I hadn't noticed it exists. – einpoklum Feb 18 at 11:58

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.