Multiprocess Firefox
developer.mozilla.org
developer.mozilla.org
I am really worried about this change because I have used Firefox since its version 1.5 and am very familiar with all its problems and successes through the years.
I've never understood this. Isn't that what bookmarks are for?
I currently have 80 tabs open, and process-per-tab is not something I'm looking forward to.
1. Support Ticket workspace -- one for RT, more tabs for related research
2. internal wiki workspace -- one for the wiki, another for the wiki's github repo, another for a local build of the wiki
3. email / meetings -- one window for calendar+tasks, one for email, with and 1-2 extra tabs for documents or links sent my way
4. Site Reliability -- one for nagios alerts, one for site testing, one for munin, and one for github PRs
5. management -- weekly management meeting agenda google doc, a key report or two, and maybe a slides for a presentation I've been asked to give or review
Edit: IMO, I'm perfectly happy to give up Memory if it means one tab crashing doesn't kill the entire process. Even at 100MB per tab, 5GB is like under 50 bucks.
It's worked well for me, when flash inevitably crashes it doesn't take the other workspaces with it, but it's perhaps not the most elegant of solutions.
When I get a chance to plow through a few dozen/hundred of these tabs I can read/view them and close them very quickly. Notice all the UI stuff I don't have to do: I never had to perform the the actions of saving a bookmark, opening a list of bookmarks, opening a specific bookmark, or deleting a bookmark.
I clicked a link once upon a time, and I will close the tab some time in the future.
When I switch to and close ten tabs, all I have to do from a UI perspective is type q ten times.
When the tab page title shrinks and all I see is favicon, I feel lost.
Also in Firefox the tabs never shrink to just favicon, the tab heads become a scrollable list. Much better than Chrome imo.
I'm quite comfortable with a tab group filled to the point where the tab bar only displays favicons, but hasn't gotten to the point where it lets me scroll yet. That way I can rely on spatial memory to get to the right tab, without necessarily seeing the title!
Of course, searching for the right tab is an option, just like you said. I love the fact that Firefox also activates the correct tab group automatically.
And I can always switch to a different wm altogether if I'm not comfortable.
Obviously you can easily achieve the same thing in separate windows as well, so ultimately I suppose it doesn't make a huge difference, but it's the way I find makes for the biggest difference in separating workspaces.
https://addons.mozilla.org/en-US/firefox/addon/tree-style-ta...
It allows you to use your tab-list in a hierarchical way, sort of like a filesystem. I group things under obvious roots, and then collapse it till needed.
I use buffers (in Conkeror). Buffers are just tabs without the actual tab UI. So unless I'm switching buffers, the only visible UI difference between having one buffer and 2000 buffers is the string "[2011/2011]" in my status-line showing my current buffer number and total number of buffers.
I can press C-x b (switch-to-buffer, I bind to M-a) to show a filterable list of my current buffers (favicon, url, title). I can type part of the url or page title (even when tab is unloaded) to filter my buffer list before switching to one. I can also navigate tabs "spatially" (from tab #2 to either tab #1 or #3) or by recently used (bury/unbury-buffer or switch-to-recent-buffer which shows buffer list in most recently used order) or by domain (next-buffer-same-host) or by whether the buffer is playing audio (switch-to-audio-buffer).
Also, in the vast majority of cases I only access recent tabs near the end of the list. I can press 9 or 0 to go to my second-to-last or last buffer.
Nonetheless, that's why I like firefox, I can do that, not so possible with Chrome. So like other said, I really really hope that they take into account this use case.
I think the lazy loading on session restore has been built in to Firefox for a while now, but I still use Session Manager. It shows me the number of tabs in the session before I choose to restore it, and if I hit a problematic page that is making the browser immediately crash, I can remove that page from the session before restoring, as well.
[1]: https://addons.mozilla.org/En-us/firefox/addon/session-manag...
I use it all the time whenever I get to 10-15 "idle" tabs I don't need that day anymore.
https://chrome.google.com/webstore/detail/tabvention/kcjmdpj...
I open and use dozens of tabs (up to 100, then I bookmark all with one click and close all). But all tabs are active in memory in IE11 or Chrome so I can switch between them (sure I trade GBs of RAM for time, but that's okay). Firefox unloads tabs, so it reloads the page - that's better if you re-open Firefox as it only loads one tab instead of loading all tabs like in Chrome/IE but worse if you have it open and actually work in the browser. So for me it's a trade off, and I find it good I have a choice for different tasks I can choose the best way.
Tabs are a good LIFO stack of things which are currently "live", or at least not dealt with yet. It's easier to navigate than history or bookmarks. You could argue that at some point tabs should "spill" into bookmarks, but that requires making a decision.
- For security, more processes is better; one per tab is probably ideal.
- For crash protection, ditto.
- For responsiveness, one process per CPU core is probably best.
- For memory usage, one process is probably best."
as a dev wrote in the mailing list: https://groups.google.com/forum/#!topic/mozilla.dev.platform...
For various technical reasons Firefox e10 will support a few sub-processes in near future, but nothing is set in stone. Rust based Servo supports (afaik) dozens of processes, as we know it from Chrome and IE.
Chrome is really lagging behind Firefox in this, as it has no backgrounding / unloading process that I'm aware of to maintain a reasonable memory footprint.
It also attempts to render every tab at once when restoring after a crash - another obvious problem.
That's why having proprietary technology in browsers sucks because you can't really implement it the way you want to (as a browser vendor).
Here is the original paper: https://crypto.stanford.edu/cs155/papers/sfi.pdf
This is obviously anecdotal, but both e10s and the Nightly in general have been remarkably stable during the time I've tested them.
The only thing I really miss is a view WebSocket frames. In many other cases I ended up preferring Firefox Dev Tools which I think while a bit harder to get into are more powerful.
But that might really relate to what precisely one is doing. I am not a web designer.
You can also use the developer toolbar to run a command like `dbg blackbox --glob *-min.js` etc. to blackbox a bunch of stuff at once.
https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_...
I had to move away from Chrome just on the battery life issue. I suspect (but cannot conclusively prove) that the multi-process crap that Chrome has just drains your battery much faster. And yes I am perfectly aware of the supposed fix in Chrome for the battery killing bug.
Launching processes is a bit expensive especially on WinNT series (up to Win10), but ultimately it's the way to go ("sandbox" = sub-processes with minimum permissions) - even Servo with its Rust language use it as certain parts like the JavaScript engine are still C/C++ based (come from Firefox/gecko) for the near future and can crash.
You can change this by increasing the "dom.ipc.processCount" preference in about:config, but there are still some known bugs with multiple content processes in desktop Firefox. There will be more work on multiple content processes in the future.
In both IE 8-11 and Chrome 1+ there are several tabs per sub-process. Chrome comes even with its own "Taskmanager" where you can see which tab sits in which process and how many resources it takes. You can find the Taskmanager in the Chrome's "Tools" sub-menu.
When you say the browser freezes, is it permanently deadlocked or does the video eventually start playing? Firefox 38 on Linux does not support MSE (Media Source Extensions), so YouTube's HTML5 video player can't use adaptive streaming. YouTube is blocked on Firefox's download and rate estimation of the video. It sounds like the YouTube player or Firefox might be stuck in a busy loop downloading the video.
To test whether the video download is causing the problem, you could try flipping the "media.mediasource.enabled" to about:config pref to true and "media.mediasource.whitelist" about:config pref to false (and restarting Firefox) to see if MSE helps. Alternately, MSE is enabled on Linux in Firefox Nightly (41) and Dev Edition (40) so you could just try them.
Does Flash play without freezing, if you have Flash installed? Flash on Linux supports H.264, but Firefox only supports VP8, VP9, and WebM unless you have gstreamer's H.264 decoder installed (but it has its own problems).
Maybe Mozilla is planning for the future better than all others. Perhaps in another 10 years Firefox won't be a shitty user experience. I will gladly switch if that becomes the case. I'm not holding my breath.
More context here: http://stackoverflow.com/questions/1050222/concurrency-vs-pa...
They do overlap in that Firefox is starting to include little bits of Rust for things the the URL parser or image decoders.
I want (and do to an extent) to love Firefox. It was what at one time what expressed to me that there was an alternative to ie. But, I now, in the real world (at least the world I inhabit) can not find it to be better than chrome in any instance. From dev tools to performance. I had no intention of trying to test the differences; I happened to be using ffx for the proxy reason and was saddened to see it had crashed the following day.
Here's to hoping this speaks to progress in this regard.
(Speaking from OS X)
https://billmccloskey.wordpress.com/2013/12/05/multiprocess-...
Today, the browser more and more becomes that, which was called "operating system" some years ago. Many applications today run just from the browser and instead of switching apps, you switch the tabs....
So, it is just a good idea in my opinion to upgrade the security of the browser to a higher level.
I am not sure about the memory consumption, but since Chrome seems to have solved this topic, also Firefox should be able to, and maybe it's also time for me to switch back?
The reason I never promoted Chrome/ium to my "main" browser, instead using it sporadically whenever I decided I wanted to look at a page that use Flash is basically because Chrome is extremely RAM and CPU hungry in use cases where the number of user tabs are high (not sure what the tipping point is, but I regularly have more than 100 tabs present in my browser -- granted, not necessarily loaded).
Restoring a session with that many tabs basically disables the computer if using Chrome, necessitating a coffee break while pages load. Electrolysis in Firefox retains the lower RAM and CPU usage of the single process model, and also happens to feel much snappier day to day - I would absolutely recommend that you give the latest nightlies a shot -- or Firefox Aurora, which prompts users to turn it on: https://wiki.mozilla.org/Electrolysis#Schedule
I also switched to Chromium a few years ago because it felt way more responsive at the time. Then slowly over time it grew into this beast using over 7GB of memory for my ~50 reasonable tabs (nothing extreme, mostly articles) and it started thrashing my system.
I've just recently switched back to Firefox and opened the exact same tabs: it's using 1.25GB. It feels a little slower at times but well within my requirements of usability. I refuse to waste all my memory for some text in a browser.
I actually think this was a far better idea (but ironically unthought of) during the days of ActiveX and a much less sensible idea today in 2015.
Those sorts of fit-and-finish bugs really bother me, and I'd love to figure out how we can fix that one for you.
These 'design' decisions are quite silly IMHO. But I will find the original bug report and CC you on it.
Here is one of several you get when you search for 'Forward' button
Oh, I see it's not one process per tab. So does anyone know how I can more easily survive on 2GB with many tabs, other than by constantly killing processes?
You could also try one of the BarTab extensions² and Tab Groups³ to only keep the sites you use loaded.
1: https://addons.mozilla.org/en-US/firefox/addon/ublock/
2: https://addons.mozilla.org/en-US/firefox/search/?q=bartab
3: https://support.mozilla.org/en-US/kb/tab-groups-organize-tab...
So I'd say that I keep many tabs open for the exact opposite reason. It enhances what I can do, due to the limitations of my brain.
Within a few decades, I expect for the concept of open tabs and bookmarks to merge. We'll be keeping far more tabs open, and flipping between them effortlessly, or scrolling back to that snapshot in time effortlessly.
I imagine closing tabs will be being like closing Emacs buffers. In practice, you practically never have the need to close an Emacs buffer, for anything you might have a small chance of wanting to work on again soon.
Between lazy tab restore and Chrome's process per tab memory overhead, Firefox is currently waaay better than Chrome for those of us coping with RAM Deficit Disorder and O(e^x) tab syndrome; I hope when the Fox gets process-per-tab they don't close that gap.
And given the amount of dev time that's gone into Chrome / Chromium, it doesn't exactly set a good precedent.
Also, you're missing that there are a number of things that have to be duplicated in a multiprocess model that you only need one of in a multithreaded model. For instance: the JS heap, which has a reasonable amount of overhead.
Some things can be shared between processes like they can be between threads, but not everything.
1: https://blog.mozilla.org/nnethercote/category/compartments/
Edit:
A quick, 100% scientific™ test:
Content processes: 50
Sum: 1858.6
Max: 42.72
Average: 37.172
Content processes: 10
Sum: 791.96
Max: 88.96
Average: 79.196
Content processes: 5
Sum: 624.1100000000001
Max: 137.68
Average: 124.82200000000003
Content processes: 1
Sum: 453.89
Max: 453.89
Average: 453.89
Based on running the following script on a freshly generated about:memory profile: var max = 0;
var sum = 0;
var vals = $$('span[id^="Web Content"][id$="explicit"] span.mrValue');
for (let vi = 0; vi < vals.length; vi++) {
let v = parseFloat(vals[vi].textContent);
sum += v;
max = Math.max(max, v);
}
console.log('Content processes:', vals.length);
console.log('Sum:', sum);
console.log('Max:', max);
console.log('Average:', sum/vals.length);
This is with ~400 tabs opened but in "unloaded" state. Only 5 pages were actually fully loaded.50 processes caused stuttering when scrolling in the tab bar. 10 & 5 processes felt smooth and allowed tab titles of background tabs to load in quickly during startup. 1 process took forever to actually load in the tab titles of background tabs on startup.
Setting changed via: about:config?filter=dom.ipc.processCount
I'm more talking about metadata / caches. There's a fair bit of stuff that can be global with a single process that cannot be with multiple processes. Sometimes you can use shared memory tricks, but not always.
Also: I wasn't aware there was that much of a memory penalty. Yow.