Was the 12GB with another RAM-intensive app running? Or just Firefox by itself.
Unlike MEM_RESET, this allows you to prioritize the memory you offer, as well as provides some extra safeguards it seems.
No idea if Firefox uses this or MEM_RESET.
[1]: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi...
[2]: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi...
This actually looks exactly like the malloc/free use case.
Browser > OK we can purge these tabs first
is how it should work. If the first step doesnt happen, its not clear if the second one should execute by itself. Id be much more concerned about background CPU usage. Eats battery, and actually slows the computer down.
That all said, its pretty clear that browsers are leaking RAM sometimes. I remember bed bath and beyond using 9 or 12GB of ram the other month.
That's not how it works. Browser might monitor free system memory actively and release memory if the system runs low, but at least Firefox doesn't do that.
There is no mechanism (in Windows, Linux) that allows the OS to notify applications of memory pressure or that allows the application to tell the OS that some allocations can be thrown out if need be. (Windows has a mechanism - MEM_RESET - that only works with paged out allocations)
Edit: Windows 10 (8?) actually expands on MEM_RESET with Offer/ReclaimVirtualMemory, but I kinda doubt browsers use this, because these have similar semantics to MEM_RESET (except they seem to work without paging, which is good). For an application that wants to cache not-well-defined amounts of data itself these might be very useful though, because you can make the data structure simple enough that it works with these.
There are mechanisms for both of these in up-to-date Linux - pressure stall information and volatile ranges, respectively.
If all of my memory is "in use" but half of it is cached file pages, should Firefox compact its heap and evict cached images? What if all of my memory is spoken for but a bunch of it isn't actually committed, due to overcommit?
Browser> So this memory here, I don't really care if you swipe it in the future.
(later)
OS> Yum yum
(later)
Browser> Oh, that buffer is empty, let me fill it again.
Firefox uses it, IIRC, for decoded image buffers.
https://searchfox.org/mozilla-central/source/memory/volatile...
Both approaches are needed to maintain a balance and to preserve real choice for users — there is no practical difference between Chrome, MS Edge, and Brave because their differences are skin-deep at best.
- Maxthon - https://www.maxthon.com/mx5/features/dual-core/
- Midori - https://www.midori-browser.org/
I'd say the scenario is similar to Firefox/Gecko and Chrome/Blink. Sure there are clones that use the Gecko and Blink engines, but none of these really are as popular as their original.
I am waiting for another Opera / Presto browser platform to emerge. Till it did, the browser market dominated by Internet Explorer was literally stagnant. Opera with a Presto engine was a game changer with their light-weight and super fast browser engine with feature sets that all other browsers copied (and still lack even today).
edit: FF cycles smoothly (although with a weird white strobing effect with the main blank content area) if I open a bunch of blank tabs, but not if they're actual web pages.
Now if Apple could just fix their damn flexbox bugs and implement web app features...
Furthermore, all these forks result in bugfixes and new features making it back into Chromium. That allows Chromium to evolve faster than other browsers. That's not to say that Firefox hasn't been keeping up and pushing past Chrome on some important fronts (CSS Sub-Grid, for one), but I'm afraid a point will come where Firefox can't keep up with all the new web APIs that developers will want to use.
Another fork of Chromium doesn't lessen Google's influence over the market.
> It means that Google can push technologies that benefit their ad tracking business, or choose to use non-standard APIs to make their apps run faster than competitors. Both of these things they're already doing.
That's at the core of their whole thing.
> Start with Blink and modify as they see fit and eventually fork if needed
One of the foundational ideas behind the web is that you have a set of open standards that specify the web, and then people can go ahead and implement those standards and provide some unique set of features on top of those standards. For example: privacy.
I believe that Google and other big-tech actors are working to make the scope of these standards so vast and so fast-moving that it becomes impossible for a small or mid-range operation to implement and maintain a web browser. I mean, who was able to successfully fork and maintain a fork of KHTML/Webkit? Google! No small organization is capable of this. These are massive, complicated codebases that must keep up with evolving standards.
Therefore, even though you theoretically have "open standards," we're seeing a future with possibly a single implementation of those standards. And if you only have one implementation, then the whole foundation doesn't hold, i.e. you can't make a privacy-oriented browser because you can't make a browser in the first place. What if some day Google decides to stop contributing to Blink, to fork Blink and only update it closed source, against a set of fast-moving standards that they de-facto control? Or what if, at that point, with total domination, they stop following open standards entirely. I think that would be the end of the web.
MSHTML.DLL
On chrome I've had 60+ tabs open for weeks without my system taking a dive.
This is on an ubuntu 19.10 system with 32gb of ram.
Here is how it looks on my system.
firefox-bin─┬─GPU Process───35*[{GPU Process}]
├─Privileged Cont───27*[{Privileged Cont}]
├─RDD Process───5*[{RDD Process}]
├─Socket Process───5*[{Socket Process}]
├─Web Content───28*[{Web Content}]
├─2*[Web Content───27*[{Web Content}]]
├─Web Content───33*[{Web Content}]
├─Web Content───22*[{Web Content}]
├─Web Content───30*[{Web Content}]
├─Web Content───32*[{Web Content}]
├─WebExtensions───27*[{WebExtensions}]
├─firefox-bin
└─97*[{firefox-bin}]
Here is a bit of bash to turn a number of bytes into a human readable label shamelessly stolen from somewhere saved as human #!/bin/bash
b=${1:-0}; d=''; s=0; S=(Bytes {K,M,G,T,P,E,Z,Y}iB)
while ((b > 1024)); do
d="$(printf ".%02d" $((b % 1024 * 100 / 1024)))"
b=$((b / 1024))
let s++
done
echo "$b$d ${S[$s]}"
Here is the best formulation of finding the memory usage of foo where foo can be a regular expression echo 1024\*(pgrep foo| xargs pmap -x|grep total|awk '{print $5}'| paste -sd+ -)|bc|xargs human
In fish the meminfo function with custom functions not herein included function meminfo
pgrep $argv| each pmap -x|g total|nth 5|sumof|multiplyby 1024|each human
end
Most of firefox's mememory is in firefox, Web Content, and WebExtensionsmeminfo firefox returns only 250MB right now but meminfo 'firefox|Web' returns 1.5GB
If you are looking at just firefox you are definitely not getting the whole picture.
For context
pgrep --full /usr/lib/firefox/firefox | wc -l
returns 10, while pgrep 'firefox|Web' | wc -l
returns 9.Your posted command formatted and a missing $ added (I'm using bash):
echo 1024\*\
$(\
pgrep --full /usr/lib/firefox/firefox \
| xargs pmap -x \
| grep total \
| awk '{print $5}'\
| paste -sd+ - \
)\
| bc \
| xargs ./human
returned 220.63 MiB.Here's my htop excerpt:
3532M 286M 97512 S 0.0 9.6 9:20.59 │ └─ /usr/lib/firefox/firefox
2325M 74708 56596 S 0.0 2.4 0:00.42 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 41
2509M 121M 85300 S 0.0 4.1 0:15.84 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 40
2489M 173M 103M S 0.0 5.8 0:18.64 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 39
2389M 74172 57060 S 0.0 2.4 0:13.49 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 23
2540M 112M 89996 S 0.0 3.8 0:50.95 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 22
2513M 72396 58300 S 0.0 2.4 0:14.88 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 17
2413M 46488 34892 S 0.0 1.5 0:18.37 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 16
250M 2132 1916 S 0.0 0.1 0:00.13 │ ├─ /usr/lib/firefox/firefox -contentproc -parentBuil
26.4G 85844 35008 S 0.0 2.8 0:57.39 │ └─ /usr/lib/firefox/firefox -contentproc -childID 3
Not sure what to make of it.memory wise it will consume quite a bit when managing streaming content and even leave the code in memory when all related tabs are gone; I assume this happens because of the dearth of video content on many web pages
Waited a bit and now have:
* Resident Set Size: ~ 500 MB
* Virtual memory: ~ 3300 MB
Not much, IMO, especially as virt. memory doesn't tells one much.
Is that really the only feature people care about?
(That said I continue to use Firefox exclusively b/c 1) Firefox is really good now, 2) best addon/extension support, 3) Google’s leadership is Evil now, and 4) I don’t want a rendering engine monoculture).
I'm fairly certain I used to have hundreds of tabs open back in the old Firefox with even less lag than I see today.
I used to do something similar too with Opera (the original one with Presto engine) but with their "Speed Dial" feature. I miss Presto Opera - it was light-weight, fast and wasn't bogged down by even with 100's of open tabs and had fantastic browser features that nearly all their competitors copied.
I am skeptical about this part. If you tag your bookmark's, it then becomes easy to look it up right from the address bar by just typing a tag name. That is actually much easier and faster than searching through 100's or 1000's of tabs.
> ... and it also stores history
That's a very good point that I hadn't considered.
I usually don't close my research tabs until I've completed the task I was working on. Not having to worry about memory means I don't have to worry about finding useful webpages again.
If I have too many tabs open, I just bookmark and tag the site I still may want to want peruse later, and close the tab.
The problem with bookmarks is my list of bookmarks eventually grows even larger than my open tabs, far larger, and stuff just gets lost in there. Once out of site, then out of mind. Leaving it open in a tab I’m more likely to go back and read it when I have time.
Multi tasking (each task can easily have a good number of tasks open)
I care about the feature but i don't see any reason to switch away from Firefox for it...
- Why keep a site open when you are done with it?
- Too many tabs and it gets difficult and irritating to find and open the site you want.
- Have never needed to keep many, many sites open in the first place.
> - Why keep a site open when you are done with it?
Why assume you're done with it? I have a number of tabs just for Grafana dashboards I'm monitoring. Re-finding the particular configuration from the home page every time would be annoying, bookmarks would require reloading the page (and thus re-running the slow queries that happen on load instead of on data update), etc.
> - Too many tabs and it gets difficult and irritating to find and open the site you want.
That's what tree-style tabs solves. Tabs are a hierarchy, just like bookmarks or folders normally are. It's much easier to navigate.
> - Have never needed to keep many, many sites open in the first place.
I've got email, calendar, a bunch of Grafana tabs, plus a few datasheets, a schematic, Jira, Confluence, and Github.
And that's just for work, for news I tend to open articles in tabs with HN comments in child tabs and then go through & read them in sequence, but I keep work & non-work in different windows.
I'm up to around 500 tabs across 3 windows. Maybe a dozen root trees. Youtube, Android docs, HN, Reddit, etc, for example. Because opening links in a new tab creates a child tab in the tree, they're automatically well-organized in a way that follows my thoughts, collapsible when I'm done with one for the moment, and rearrangeable if I don't like where they were put in the tree.
https://addons.mozilla.org/en-US/firefox/addon/tree-style-ta...
https://addons.mozilla.org/en-US/firefox/addon/auto-tab-disc...
I also do this, but my definition of done is very flexible and blurry.
Which browser?
I'm a front end and back end developer that uses multiple libraries and tech stacks and need to find answers to stuff immediately. I leave them open as a resource while I'm working, which may be on multiple things at once. In addition, I have mail, messaging, music, and other work-related things open in the browser.
It's really one of the only features that matters.
On one Windows PC, I keep 2-3 tabs constantly open (may as well pin them tbh), and open/close others as needed. Average tab footprint is probably 3-8 tabs. Average RAM footprint is 1700MB. I have different tab footprints on different machines, of all sorts of different hardware and OS combinations; let's say the general tab footprint is 5-30 tabs, and general memory footprint is 800MB-3GB.
On the other hand, one user here reported a few thousand tabs at ~500MB RSS.
Obviously factors like assets and JavaScript affect RAM consumption, but a lot of these heavy tab users have to be running a good number of web apps. There must be something else at play.
Sure, let me just go download some more RAM. It's not like it's a finite resource in my machine or anything.
Firefox sitting at 12 gigs Vivaldi sitting at 5 gigs
This is on MacOS, so mileage may vary and all that, but with the same tabs open, why would there be such a difference?
Edit: And there's no difference in the plugins. I use the same plugins on both browsers: password manager, uBlock Origin, React dev tools, and Redux dev tools and that's it.