“4 sub-processes when I only have two tabs?”
I don’t know anything about Firefox’s specifics, but forking an already initialized process typically is faster than launching a new process, so if I were to write a multi-process browser, I might have an empty, initialized, process hanging around of every type that can be forked and then sent a message to load a page or extension.
Alternatively, Firefox could keep processes running on the decent chance that you will want to open a new tab soon.
If you go to about:memory and click on "Measure" you can get some information about what is in memory. In addition to web pages, Firefox uses child processes for things like the new tab page, extensions, talking to the GPU, and some other things. It also uses a preallocated process like another commenter suggested, to speed up opening a new page.
Re:Browsers eating RAM
by deanclatworthy on Thursday February 18, 2021 @11:14AM
(#26181636)
I don't think you can compare Windows Vs Mac when it comes to FF. There have been countless complaints about FF mac performance over the years - even after they supposedly fixed it all.
15 FF tabs open currently: https://ibb.co/MRkJjwY
- 1 outlook email tab - 1-2 custom web apps for dev work - the rest are jira and gitlab
Check `about:processes`. (I'm not sure if this is only available in Nightly right now.) It lists all processes, threads, and their memory + CPU usage.
Re:Browsers eating RAM
by warmwaffles on Thursday February 18, 2021 @09:37PM
(#26188890)
This is cool. I did not know this was a thing.
https://imgur.com/a/UJnV7ak
Adding up the RAM totals 671.7MB on a 16GB device. But why do I have one Firefox with 4 sub-processes, and 3 (no 4) additional lone Firefox processes? I think the 4 background processes must be extensions in sure, but then what is the primary process with 4 sub-processes when I only have two tabs?
Without extensions, it looks like the browser is using about 280MB.