# Firefox on FreeBSD: shared web content processes, -isForBrowser and dom.ipc.processCount



## grahamperrin@ (Dec 27, 2021)

`dom.ipc.processCount` is `8` (the default here). Recently, I often see more than eight content shared web content processes, for example:






Is this excess allowed, by design?

A later shot:



After a few tests, it seems that the expected number is used if, say, I have three windows open before quit. For example, eight `-isForBrowser` content processes after Firefox finished opening previous windows and tabs:



The excesses seem to begin when I load any restored non-loaded tab.

I'm not immediately concerned about performance etc., just curious about the number of content processes.

<https://cgit.freebsd.org/ports/log/www/firefox>


```
% pkg info -x firefox
firefox-95.0.2,2
% pkg -vv | grep -e url -e enabled
    url             : "pkg+http://pkg0.bme.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    url             : "https://alpha.pkgbase.live/current/FreeBSD:14:amd64/latest",
    enabled         : no,
    url             : "file:///usr/local/poudriere/data/packages/main-default",
    enabled         : yes,
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #118 main-n251923-4bae154fe8c: Sat Dec 25 08:03:37 GMT 2021     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64 1400045 1400045
%
```


----------



## CuatroTorres (Dec 27, 2021)

Process Model — Firefox Source Docs  documentation
					






					firefox-source-docs.mozilla.org


----------



## drhowarddrfine (Dec 27, 2021)

Isn't this a question for Mozilla?


----------



## CuatroTorres (Dec 27, 2021)

If you run Firefox on a machine within Mozilla's installations it makes perfect sense.
Sorry, Xmas mood. x-)


----------



## grahamperrin@ (Dec 27, 2021)

CuatroTorres said:


> <https://firefox-source-docs.mozilla.org/dom/ipc/process_model.html>



Thanks. Pinpointing, for `dom.ipc.processCount`:

<https://firefox-source-docs.mozilla.org/dom/ipc/process_model.html#shared-web-content>


----------



## CuatroTorres (Dec 27, 2021)

Tech answer:
Shared web content is not the only process in Firefox.


----------



## grahamperrin@ (Dec 27, 2021)

Thanks. With reference to the screenshots, can you tell, are any of the `-isForBrowser` content processes _not_ shared web content?


----------



## CuatroTorres (Dec 27, 2021)

Nope. Find if the tabs have subtasks in "about: performance".





						Electrolysis - MozillaWiki
					






					wiki.mozilla.org


----------



## Alain De Vos (Dec 27, 2021)

In preferences-settings-performance you can limit the maximum number of spawned-content-processes.


----------



## grahamperrin@ (Dec 27, 2021)

CuatroTorres said:


> Find if the tabs have subtasks in "about: performance".



No subtask for any _Tab_ type. 

Re the closure at <https://wiki.mozilla.org/index.php?title=Electrolysis&type=revision&diff=1193871&oldid=1185052>, I don't imagine the Electrolysis page being updated with regard to more recent developments.


----------



## grahamperrin@ (Dec 27, 2021)

Alain De Vos said:


> In preferences-settings-performance you can limit the maximum number of spawned-content-processes.



It's not customised. 



grahamperrin said:


> `dom.ipc.processCount` is `8`


----------



## drhowarddrfine (Dec 28, 2021)

grahamperrin said:


> No. If you're not yet aware, there's a port: <https://www.freshports.org/www/firefox/> with a number of patch files <https://cgit.freebsd.org/ports/tree/www/firefox/files> and so on.


I've been running Firefox since version 0.9. Maybe I'm more aware than you. But do the patch files have anything to do with the issue you are trying to bring up with FreeBSD? If so, which patch files and exactly what within those files? Don't make us hunt for it if you already know.


----------



## grahamperrin@ (Dec 28, 2021)

drhowarddrfine said:


> Isn't this a question for Mozilla?



To help understand why it's sometimes inappropriate to begin with Mozilla for Tier-3 questions:

Supported Build Hosts and Targets — Firefox Source Docs documentation



drhowarddrfine said:


> Don't make us hunt for it if you already know.



Generally: if I know the answer to a question, I do not ask – I don't like to waste space.


Back on topic:



drhowarddrfine said:


> … do the patch files have anything to do with …



Sorry, I don't know, I'm not a coder.

If I understand correctly, it's *relatively easy to see, on FreeBSD*, approximately *how many shared web content processes are running*. 


Easy relative to Linux, for example, where _scores_ of `-isForBrowser` processes might be seen when Firefox presents a _single_ tab:


----------



## grahamperrin@ (Dec 28, 2021)

If we ignore the first question, this single alternative question should be easier to answer:

with recent versions of Firefox, do you ever see _many _more `-isForBrowser` processes than the number that's set for `dom.ipc.processCount`?
A view of *about:config* in Firefox:



As pictured in post #1, you can use the F4 key with sysutils/htop to filter: _-isForBrowser_

If not htop(1), use whatever you find easiest for a filtered view of things. `ps aux | grep firefox | grep isForBrowser | sort` or whatever. 

Thanks


----------



## drhowarddrfine (Dec 28, 2021)

grahamperrin said:


> Generally: if I know the answer to a question, I do not ask – I don't like to waste space.



That's not what I'm asking. You asked why there were so many processes. I asked if this isn't a question for Mozilla, not FreeBSD. You pointed to a bunch of patches which I assumed meant therein lies the problem--as if it is a problem--but why are you pointing us at those patches? We need some context and clarity.

I'm not a "coder" either. I'm a programmer.


----------



## grahamperrin@ (Dec 28, 2021)

drhowarddrfine please ignore what's not clear.

If anyone can answer the other question, I'll appreciate it.


----------



## CuatroTorres (Dec 28, 2021)

Bad link for Electrolysis.

You can get information about PIDs in about: processes.






						Capturing a minidump — Firefox Source Docs  documentation
					






					firefox-source-docs.mozilla.org
				







You can also see the number of open web content processes in about: support.


----------



## grahamperrin@ (Dec 28, 2021)

Thanks,



CuatroTorres said:


> … You can get information about PIDs in about: processes. …



IIRC *about:processes* is simply _not_ a page that's expected to work in the (Tier-3) port to FreeBSD. I don't open bugs for things such as this.


----------



## grahamperrin@ (Feb 13, 2022)

Please: *did anyone else find the excesses* (pictured in the opening post) with Firefox 95.⋯ or 96.⋯?

Early indications are that Firefox 97.⋯ is free, or almost free, from the issue (if, in fact, it _was_ an issue):



nine `-isForBrowser` Firefox processes
maybe one more than expected – not nearly as many more as in the opening post.


```
% pkg info -x firefox
firefox-97.0_3,2
% grep pkg /var/log/messages | grep firefox
Feb 11 23:16:57 mowa219-gjp4-8570p-freebsd pkg[2177]: firefox upgraded: 97.0_2,2 -> 97.0_3,2
% zgrep pkg /var/log/messages.0.bz2 | grep firefox
Feb  3 09:43:37 mowa219-gjp4-8570p-freebsd pkg[2388]: firefox upgraded: 95.0.2_2,2 -> 96.0.3,2
Feb  4 16:33:09 mowa219-gjp4-8570p-freebsd pkg[2484]: firefox upgraded: 96.0.3,2 -> 97.0_1,2
Feb  6 12:35:11 mowa219-gjp4-8570p-freebsd pkg[2116]: firefox upgraded: 97.0_1,2 -> 97.0_2,2
Feb  9 19:18:44 mowa219-gjp4-8570p-freebsd pkg[4743]: firefox-97.0_2,2 deinstalled
Feb  9 19:19:42 mowa219-gjp4-8570p-freebsd pkg[4761]: firefox-97.0_2,2 installed
Feb  9 19:20:27 mowa219-gjp4-8570p-freebsd pkg[4871]: firefox-97.0_2,2 deinstalled
Feb  9 19:21:09 mowa219-gjp4-8570p-freebsd pkg[4905]: firefox-97.0_2,2 installed
% date ; uname -aKU
Sun 13 Feb 2022 16:49:48 GMT
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #3 main-n253116-39a36707bd3-dirty: Sat Feb 12 16:47:35 GMT 2022     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64 1400051 1400051
% bectl list -c creation
BE                    Active Mountpoint Space Created
n250511-5f73b3338ee-d -      -          4.94G 2021-11-13 15:43
n252381-75d20a5e386-b -      -          6.80G 2022-01-12 23:23
n252450-5efa7281a79-a -      -          6.49G 2022-01-14 19:27
n252483-c8f8299a230-b -      -          4.84G 2022-01-17 14:24
n252505-cc68614da82-a -      -          4.90G 2022-01-18 14:26
n252531-0ce7909cd0b-h -      -          5.71G 2022-02-06 12:24
n252997-b6724f7004c-c -      -          836M  2022-02-11 23:07
n253116-39a36707bd3-a -      -          24.5M 2022-02-12 17:19
n253116-39a36707bd3-b NR     /          128G  2022-02-12 18:33
%
```

Postscript

Sorry, the first screenshot was too soon. A later screenshot showed a greater number of processes:


----------

