You are not logged in.

#1 2019-07-23 23:10:54

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 12

Firefox hogs RAM

In the last few days, probably starting when I upgraded to FF 68.0.0, I had the problem where FF would start consuming huge amounts of memory very fast and the whole desktop would freeze for long periods. I know FF was the culprit because I have conky running and it would show the percentage of RAM used by FF increasing fast until conky itself would freeze.

This happened to me maybe 10 times over a few days. Very annoying. I had to 'kill' FF.

Yesterday I did two things: erased the FF cache (except for cookies and site data) and 'vacuumed' the FF sqlite database. Since I did that the problem has not manifested. My guess is that what fixed it was erasing the cache rather than vacuuming.

Anyway, just want to mention this in case someone runs into a similar problem.

P. S. I vacuumed with this command in the FF profile folder:
for i in *.sqlite; do echo "VACUUM;" | sqlite3 $i ; done

Offline

#2 2019-08-11 11:15:09

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 12

Re: Firefox hogs RAM

An update: the problem came back after I posted the above. Also there are other threads in this forum about people saying that Firefox freezes so I was not the only one with this problem.

But then the problem disappeared without me doing anything, just like it had appeared without me doing anything.

I have no clue why the problem disappeared. It was not a Firefox update that fixed it, it must have been an update to the kernel or to one of the libraries used by Firefox directly or indirectly. I am using Mate with the proprietary Nvidia driver.

Offline

#3 2019-08-11 11:52:36

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,346

Re: Firefox hogs RAM

How much ram do you have?


ENTER

~ Arch is not Arch unless it is Arch ~

Offline

#4 2019-08-14 02:36:15

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 12

Re: Firefox hogs RAM

8GB.

I have conky and it updates every second. It shows the list of the 6 projects that use more RAM. As I have lots of Firefox windows and tabs open, usually 5 of the top 6 projects belog to Firefox, the top one called Firefox (about 13%) and 4 others named "Web Content".

When the problem manifested the top Firefox process would increase RAM consumption very fast (over 2 - 3 seconds) to 50% and then conky would stop updating and the whole desktop would freeze for a few minutes. But after some wait I could kill the Firefox project either with a terminal or with a keyboard shortcut that I configured to kill Firefox.

As I said above it is not manifesting any more. At some stage I checked the Mozilla bugzilla to see if there was anything about this and could not find. However there is a separate post about Firefox freeze by ktatar156 in this forum and what he describes might be the same issue as mine.

Offline

#5 2019-08-14 07:24:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,065

Re: Firefox hogs RAM

What are you actually running in these tabs. For some weird reason many people completely dissasociate the website and start to look at browser tabs without regards to what is in there. It is for example not uncommon to have a few pages scrolled down facebook consume 2GB of RAM, but that's a facebook thing, and doesn't point to a leak in the browser itself. The content matters a lot here.

Offline

#6 2019-08-14 14:19:24

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,346

Re: Firefox hogs RAM

The problem here is that the kernel is really incompetent on what to do in low memory situations, I don't know the reasons why but I do know you can avoid it if you always keep some ram free for the kernel itself. To do it add swap file or partition and limit the user processes to some limit, maybe 5 or 6 GB pick whatever fits you

systemctl set-property user.slice MemoryAccounting=true
systemctl set-property user.slice MemoryLimit=5G

You can also limit system.slice if you run a lot of memory hungry services. You can go granular and set limits for each systemd service.


If that's not your cup of tea then you can just limit Firefox itself: https://www.digitalocean.com/community/ … n-centos-6

You can inspect cgroups memory usage with systemd-cgtop -m.

Learn more about cgroups they are very porwerful smile


ENTER

~ Arch is not Arch unless it is Arch ~

Offline

#7 2019-08-14 16:17:50

latalante1
Member
Registered: 2018-08-30
Posts: 30

Re: Firefox hogs RAM

ugjka wrote:
systemctl set-property user.slice MemoryAccounting=true
systemctl set-property user.slice MemoryLimit=5G

No, no, no.
When prompting such commands, you need to be consistent, explain how to restore default settings. Someone can use them, and in a week they will have no idea why his system is behaving strangely.

Suggest them in safe form.

systemctl --runtime set-property user.slice MemoryAccounting=true
systemctl --runtime set-property user.slice MemoryLimit=5G

Offline

#8 2019-08-14 16:32:43

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,346

Re: Firefox hogs RAM

Or just remove the .conf files

[ugjka@archee ~]$ tree /etc/systemd/system.control/
/etc/systemd/system.control/
├── system.slice.d
│   ├── 50-MemoryAccounting.conf
│   └── 50-MemoryLimit.conf
└── user.slice.d
    ├── 50-MemoryAccounting.conf
    └── 50-MemoryLimit.conf

2 directories, 4 files

ENTER

~ Arch is not Arch unless it is Arch ~

Offline

Board footer

Powered by FluxBB