My preferred usage pattern for Firefox includes having 20-30 windows open, with an average of perhaps 10 tabs/window. (This is my preference, so please don't bother suggesting changing this.)
With my old machine, a ThinkPad W500 running Xubuntu 14.04 LTS (very much living up to its name, Trusty), this worked fine most of the time with 8 GB RAM and a swap partition of 12 GB. At times, it would begin to slow down due to swapping, but this would typically happen after several days (sometimes more than a week) of use, and a restart of Firefox would fix it for another period. Very rarely, but typically with more than 25 windows, the Firefox process would become very sluggish or completely unresponsive, but I would still be able to switch windows to a terminal and kill it.
Under the assumption that a faster system with more RAM would improve this situation, I obtained a (used/refurbished) T520 with 16 GB RAM preinstalled from the vendor about a week ago. However since installing this with Xubuntu 17.04 last weekend, it seems to be a worse setup than what I had before. Leaving my machine idle with just Firefox (18 windows) and Terminal (4 windows) for a day, tonight I found it in a state where it was completely unresponsive, disk light constantly on with the disk trashing, to the point where even switching to a Terminal window was effectively impossible. After waiting five minutes I gave up and pressed the power button.
This was after I yesterday tried to improve performance (having had a similar problem) by tuning FF Performance: enabling hardware acceleration and setting the Content process limit to 4. (FF 55.0.2, which I had also been using on the old system since august 20.).
What is the cause of this horrible trashing, and how - other than having less windows open - can it be prevented? Given that the old system worked fine, I am considering downgrading the new machine to 14.04, but that seems an unviable option in the long run. I am also considering changing swappiness, or even running FF under a virtual machine so I can limit its resources.
Any suggestions for finding the cause, a solution or a good workaround will be highly appreciated.