Re: [oi-dev] Memory use with Firefox
On Thu, Jan 04, 2024 at 11:36:05AM -0800, Joshua M. Clulow via oi-dev wrote: > > You can ask Firefox for more information about the processes it has > started by entering "about:processes" and "about:memory" into the URL > bar. I believe the process ID is in parentheses on each line in the > list that represents a process. My "about:memory" display looks like this: 1,085.17 MB (100.0%) -- explicit ├599.16 MB (55.21%) -- gfx │├──597.14 MB (55.03%) -- webrender ││ ├──580.42 MB (53.49%) ── swgl ││ └───16.72 MB (01.54%) ++ (10 tiny) │└2.02 MB (00.19%) ++ (8 tiny) ├198.31 MB (18.27%) ── heap-unclassified ├─82.74 MB (07.63%) -- js-non-window I assume that "swgl' means "software GL", probably as a result of my Radeon HD 7450 video card not doing hardware GL. There goes 580 megs anyway. -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On 1/12/24 14:24, John D Groenveld wrote: Another defense is to confine your browsing to VMs which you can snapshot, pause, rollback, destroy, etc. Kudos to the devs for maintaining pkg://openindiana.org/system/virtualbox What's the defense against this? admin@sol:/stardust/scratch/pkg/legacy$ echo ::memstat|pfexec mdb -k Page SummaryPagesMB %Tot Kernel3840150 30001 48% ZFS File Data 3088942 24132 38% Anon93455 7301% Exec and libs1158 90% Page cache 22729 1770% Free (cachelist)77527 6051% Free (freelist)947383 7401 12% Total 8071344 63057 Physical 8054433 62925 admin@sol:/stardust/scratch/pkg/legacy$ uptime 9:15am up 12 day(s), 3:04, 1 user, load average: 1.46, 0.76, 0.59 ... Kernel3840150 30001 48% ... I saw this today and lost all motivation to care about Firefox/X.org memory consumption for awhile :-/ Everything in its context, I suppose. -- Matthew R. Trower ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
In message , Gary Mills writes: >That sounds like cnn.com to me. The media companies in .IN are doing their best to convince me that the tin-foil-hat wearing conspiracy theorists are correct that they are not in the business of capturing my eyeballs to deliver advertisements but actually to capture my CPU by delivering Javascript to mine bitcoins, solve CAPTCHAs or perform other useful work. Modern versions of Firefox handle Control-C and on restart will reload your tabs. Another defense is to confine your browsing to VMs which you can snapshot, pause, rollback, destroy, etc. Kudos to the devs for maintaining pkg://openindiana.org/system/virtualbox As Michael Conrad's character used to say in the Hill Street Blues TV show: "Let's be careful out there." John groenv...@acm.org ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, Jan 11, 2024 at 05:17:37AM -0600, Matthew R. Trower wrote: > > Seriously, though, I imagine it's going to be related to the kinds of sites > you visit, what kind of assets they're sucking down, what kind of monster > javascript frontends they want to run clientside, etc... Firefox basically > has Operating System status these days. I've seen individual tabs run > anywhere from 32MB to 500MB+ each. That sounds like cnn.com to me. > Just like with an OS, you need a process manager to answer these questions. > Unfortunately, you said that yours (about:process) wasn't working --- did > you ever figure that out? Yes, the problem seems to be with the version of firefox that was included with the OS. I'll have to do an upgrade to get that feature working. -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, Jan 11, 2024 at 09:09:27AM -0800, Alan Coopersmith wrote: > Xorg maps VRAM from your video card, so you need to use pmap on the process > to see how much is heap allocation (regular ram) vs. memory mappings. Here's the processes today: $ prstat -c -s size Please wait... PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 941 mills2558M 2532M sleep 590 58:09:13 0.1% Xorg/3 1129 mills2066M 899M sleep 490 6:15:59 0.8% firefox/177 ... Indeed, Xorg is using more memory than the main firefox process. Perhaps my Radeon video card is responsible for that. Here's how memory allocation looks in more detail: root@ryzen># pmap 941 941:/usr/bin/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten 0040 2976K r-x-- /usr/bin/Xorg 006F8000 72K rw--- /usr/bin/Xorg 0070A0002572040K rw---[ heap ] 7FFFAAA0 16384K rw-s- 7FFFABA4204K r-x-- /usr/lib/xorg/modules/amd64/libint10.so 7FFFABA83000 8K rw--- /usr/lib/xorg/modules/amd64/libint10.so ... The largest portion of it seems to be in heap allocation. At least, the size seems to stabilize pretty quickly. -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, 11 Jan 2024 at 09:09, Alan Coopersmith wrote: > On 1/11/24 03:17, Matthew R. Trower wrote: > > What's up with your Xorg, though? 2.5GB? Your display server is nearly as > > fat > > as your Firefox :O > > Xorg maps VRAM from your video card, so you need to use pmap on the process > to see how much is heap allocation (regular ram) vs. memory mappings. Would the device mapping for video RAM show up as RSS though? I'd obviously expect it to be in SIZE. Cheers. -- Joshua M. Clulow http://blog.sysmgr.org ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On 1/11/24 03:17, Matthew R. Trower wrote: What's up with your Xorg, though? 2.5GB? Your display server is nearly as fat as your Firefox :O Xorg maps VRAM from your video card, so you need to use pmap on the process to see how much is heap allocation (regular ram) vs. memory mappings. -- -Alan Coopersmith- alan.coopersm...@oracle.com Oracle Solaris Engineering - https://blogs.oracle.com/solaris ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On 1/4/24 10:54, gary_mi...@fastmail.fm (Gary Mills) wrote: I still have questions about the memory usage of firefox. Here's how memory size looked after 14 days: $ prstat -c -s size Please wait... PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 1598 mills2850M 1481M sleep 490 26:56:22 0.7% firefox/198 941 mills2558M 2532M sleep 590 27:14:03 0.2% Xorg/3 1978 mills 578M 272M sleep 590 0:03:10 0.0% firefox/25 18154 mills 569M 261M sleep 440 0:15:33 0.1% firefox/26 1868 mills 558M 254M sleep 590 0:14:22 0.0% firefox/28 1867 mills 414M 158M sleep 590 0:10:04 0.0% firefox/24 1601 mills 411M 151M sleep 590 0:01:01 0.0% firefox/24 1602 mills 384M 147M sleep 590 0:00:32 0.0% firefox/24 1866 mills 360M 124M sleep 590 0:09:19 0.0% firefox/24 18878 mills 340M 108M sleep 490 0:00:01 0.0% firefox/25 19646 mills 310M 68M sleep 490 0:00:00 0.0% firefox/12 19639 mills 310M 69M sleep 590 0:00:00 0.0% firefox/12 19642 mills 310M 68M sleep 490 0:00:00 0.0% firefox/12 1604 mills 227M 45M sleep 590 0:00:03 0.0% firefox/3 1600 mills 227M 44M sleep 590 0:00:00 0.0% firefox/4 Total: 133 processes, 1323 lwps, load averages: 0.22, 0.23, 0.21 How much memory does firefox want? All of it. Your surrender is foregone and non-negotiable. Seriously, though, I imagine it's going to be related to the kinds of sites you visit, what kind of assets they're sucking down, what kind of monster javascript frontends they want to run clientside, etc... Firefox basically has Operating System status these days. I've seen individual tabs run anywhere from 32MB to 500MB+ each. > Why are there so many firefox processes? I was expecting one process > per tab. Clearly there are many more. Why do some of the processes Just like with an OS, you need a process manager to answer these questions. Unfortunately, you said that yours (about:process) wasn't working --- did you ever figure that out? What if you start Firefox from the shell; do you get any debug output when you try to load that page? If you can get it working, it will give you a breakdown of each process, including purpose, memory, and cpu usage. It's basically top. Firefox is just not going to be slim though, no matter what you do; here is mine with two (2!) tabs --- and one of them is about:process! mtrower@saturn:~$ prstat -p $(pgrep firefox|tr '\n' ','),1306 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 20545 mtrower 1519M 611M sleep 290 0:07:39 0.2% firefox/133 1306 root 181M 49M sleep 430 0:10:39 0.2% Xorg/1 20551 mtrower17G 184M sleep 590 0:00:38 0.0% firefox/27 23507 mtrower 311M 63M sleep 590 0:00:00 0.0% firefox/12 20552 mtrower 226M 37M sleep 590 0:00:00 0.0% firefox/3 20549 mtrower 227M 37M sleep 590 0:00:00 0.0% firefox/4 22729 mtrower 403M 158M sleep 590 0:00:05 0.0% firefox/27 23506 mtrower 311M 63M sleep 590 0:00:01 0.0% firefox/12 20550 mtrower 358M 104M sleep 590 0:00:06 0.0% firefox/28 23505 mtrower 310M 63M sleep 590 0:00:00 0.0% firefox/12 Total: 10 processes, 259 lwps, load averages: 0.62, 0.91, 0.86 about:processes reports: Firefox [601MB] github.com [158MB] Tab: Extensions [184MB] About pages [105MB] Preloaded New Tab Utility [37MB] JavaScript Oracle Network [37MB] Preallocated [63MB] Preallocated [63MB] Preallocated [63MB] ...and you can see how those line up with prstat reporting. What's up with your Xorg, though? 2.5GB? Your display server is nearly as fat as your Firefox :O -- Matthew R. Trower ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, Jan 04, 2024 at 05:26:30PM -0500, Gordon Ross wrote: > Aren't those LWPs being shown? (not processes) No, those are individual processes, with the number of threads for each process also shown. The first one is the main firefox process. It has about 200 threads. Most of the others correspond to tabs. -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
Monster truck ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, Jan 04, 2024 at 11:36:05AM -0800, Joshua M. Clulow via oi-dev wrote: > > Firefox increasingly uses multiple processes as a measure of isolation > between different fault and security domains; if there is a > vulnerability or a bug in some code, it need not impact all the other > tabs necessarily. > > You can ask Firefox for more information about the processes it has > started by entering "about:processes" and "about:memory" into the URL > bar. I believe the process ID is in parentheses on each line in the > list that represents a process. The "about:processes" URL seems not to work in my version of firefox. All I see is the title bar. "about:memory" does work, but the amount of memory used seems quite small: There are no gigabytes of memory shown. I wonder if all memory is displayed there. -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, Jan 04, 2024 at 10:38:00AM -0800, Bill Sommerfeld via oi-dev wrote: > > swap reports on used, reserved, and available swap space for virtual memory; > it doesn't report on free physical memory. ZFS operates largely below > the virtual memory system and manages physical memory. I was assuming that available swap space included both physical memory and disk device space. I was further assuming that disk space was used last. > Two ways to look at free physical memory are with the "vmstat" command's > "free" column, and with "top"; "top" also displays ZFS ARC statistics. I'll try top. I used an mdb macro to determine the size of the ZFS ARC. -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, Jan 04, 2024 at 12:11:49PM -0600, John Howard wrote: > Pattern is 14 processes after 14 days. New process per day. That's not my experience. The number of processes quickly reaches a maximum. > Script to close the app at the end of each day and restart the app > for a new day. Then see what happens. That's a solved problem, one that produces a system that stays up without restarting any application. You have to limit the ZFS ARC. > BTW, you have a monster system. In what sense? -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
Aren't those LWPs being shown? (not processes) On Thu, Jan 4, 2024 at 11:54 AM Gary Mills wrote: > > I have a system that I mostly use for web brousing. It has an AMD > Ryzen 7 2700 Eight-Core Processor, and runs a recent version of OI, > from 2023-11-07. It has 48 gigs of memory with an 8-gig swap > partition. Using Firefox 119.0.1, I noticed that Firefox became > sluggish only a few days after boot. I have five permanent tabs in > Firefox, along with several temporary tabs, using the "Open in new > tab" option. I assumed that ZFS and firefox were fighting over > memory. Indeed, the ZFS ARC was using 32 gigs of memory. To fix this > problem, I put the following into a file in /etc/system.d and > rebooted: > > set zfs:zfs_arc_max = 0x2E000 > > This change limited the ARC to 12 gigs, and seems to have corrected > the problem. Firefox scrolling was quick and smooth, and continued to > be so for the next two weeks. > > After the reboot, the swap space looked like this: > > $ swap -sh > total: 940.79M allocated + 536.90M reserved = 1.44G used, 44.81G available > > After 14 days, it was like this: > > $ swap -sh > total: 4.98G allocated + 2.00G reserved = 6.98G used, 25.91G available > > The free memory seems to have stabilized at about 26 gigs. I assume > that ZFS allocates memory from this free space. > > I still have questions about the memory usage of firefox. Here's how > memory size looked after 14 days: > > $ prstat -c -s size > Please wait... >PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP > 1598 mills2850M 1481M sleep 490 26:56:22 0.7% firefox/198 >941 mills2558M 2532M sleep 590 27:14:03 0.2% Xorg/3 > 1978 mills 578M 272M sleep 590 0:03:10 0.0% firefox/25 > 18154 mills 569M 261M sleep 440 0:15:33 0.1% firefox/26 > 1868 mills 558M 254M sleep 590 0:14:22 0.0% firefox/28 > 1867 mills 414M 158M sleep 590 0:10:04 0.0% firefox/24 > 1601 mills 411M 151M sleep 590 0:01:01 0.0% firefox/24 > 1602 mills 384M 147M sleep 590 0:00:32 0.0% firefox/24 > 1866 mills 360M 124M sleep 590 0:09:19 0.0% firefox/24 > 18878 mills 340M 108M sleep 490 0:00:01 0.0% firefox/25 > 19646 mills 310M 68M sleep 490 0:00:00 0.0% firefox/12 > 19639 mills 310M 69M sleep 590 0:00:00 0.0% firefox/12 > 19642 mills 310M 68M sleep 490 0:00:00 0.0% firefox/12 > 1604 mills 227M 45M sleep 590 0:00:03 0.0% firefox/3 > 1600 mills 227M 44M sleep 590 0:00:00 0.0% firefox/4 > Total: 133 processes, 1323 lwps, load averages: 0.22, 0.23, 0.21 > > Why are there so many firefox processes? I was expecting one process > per tab. Clearly there are many more. Why do some of the processes > have so many threads? How much memory does firefox want? > > > -- > -Gary Mills--refurb--Winnipeg, Manitoba, Canada- > > ___ > oi-dev mailing list > oi-dev@openindiana.org > https://openindiana.org/mailman/listinfo/oi-dev ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On Thu, 4 Jan 2024 at 08:54, Gary Mills wrote: > Why are there so many firefox processes? I was expecting one process > per tab. Clearly there are many more. Why do some of the processes > have so many threads? How much memory does firefox want? Firefox increasingly uses multiple processes as a measure of isolation between different fault and security domains; if there is a vulnerability or a bug in some code, it need not impact all the other tabs necessarily. You can ask Firefox for more information about the processes it has started by entering "about:processes" and "about:memory" into the URL bar. I believe the process ID is in parentheses on each line in the list that represents a process. Cheers. -- Joshua M. Clulow http://blog.sysmgr.org ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
On 1/4/24 08:54, Gary Mills wrote: $ swap -sh total: 4.98G allocated + 2.00G reserved = 6.98G used, 25.91G available The free memory seems to have stabilized at about 26 gigs. I assume that ZFS allocates memory from this free space. swap reports on used, reserved, and available swap space for virtual memory; it doesn't report on free physical memory. ZFS operates largely below the virtual memory system and manages physical memory. Two ways to look at free physical memory are with the "vmstat" command's "free" column, and with "top"; "top" also displays ZFS ARC statistics. - Bill ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] Memory use with Firefox
Pattern is 14 processes after 14 days. New process per day. Script to close the app at the end of each day and restart the app for a new day. Then see what happens. BTW, you have a monster system. ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev