News for hackers. Stuff that matters.
Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @07:35AM (#8350115)
Yay, now firefox can waste just as much memory as Chrome. Guess 1GB for the whole browser wasn't enough; they had to go for ~100MB/tab.

Got to keep up with Chrome after all.</s>

If I use chrome for normal browsing (I don't normally because its feature set is poor, customisability is a dirty words, and I don't like the privacy risk), it can rapidly slurp 4GB or more of memory (with perhaps two key addons, adblock and DoNotTrackMe). Even firefox at its worst rarely if ever goes over 1.5GB, even with very heavy customisation and plenty of privacy/adblocking/etc addons.

>Performance would improve because the browser UI would not be affected by poor performance of content code (be it layout or JavaScript).

What about by the overhead from task switching hundreds of processes and mapping all the memory when each one takes up 50MB or more?

Re:Electrolysis – run web content in a separate process from... by XzetaU8 on Monday September 22, 2014 @08:17AM (#8350221)
http://billmccloskey.wordpress.com/2013/12/05/multiprocess-f... "The total memory usage for multiprocess Firefox is only 10MB greater than single-process Firefox. We should be able to shrink this difference with some effort"

As for the excess memory usage on chrome, "OneTab" might help https://chrome.google.com/webstore/detail/onetab/chphlpgkkbo... (It's available on Firefox) https://addons.mozilla.org/en-US/firefox/addon/onetab/

Re:Electrolysis – run web content in a separate process from... by aen0 on Monday September 22, 2014 @08:41AM (#8350278)
Be aware that Adblock Plus for Chrome increases significantly RAM usage for each open tab.

uBlock author has extensive benchmarks about this issue.

https://github.com/gorhill/uBlock/wiki/%C2%B5Block-vs.-ABP:-...

Re:Electrolysis – run web content in a separate process from... by ben__p__w on Tuesday September 23, 2014 @10:29AM (#8355482)
Some more info on how Adblock Plus is trying to fix the issue: https://adblockplus.org/blog/on-the-adblock-plus-memory-cons...
Re:Electrolysis – run web content in a separate process from... by sp332 on Monday September 22, 2014 @09:34AM (#8350464)
Would it have the same problem with a multiprocess Firefox?
Re:Electrolysis – run web content in a separate process from... by riquito on Monday September 22, 2014 @09:44AM (#8350498)
It may be worse, the problem is that it loads too many info per tab. If you do it on multiple processes it will not get any better.
Re:Electrolysis – run web content in a separate process from... by cpeterso on Monday September 22, 2014 @04:02PM (#8352303)
Multiprocess Firefox currently only uses one process for all tabs (plus a browser UI process). The tab process will be sandboxed, so users will get some of the security benefits of multiple tabs without the memory overhead of tab-per-process.

If you want to experiment with more than one tab process, you can tweak the about:config pref "dom.ipc.processCount".

Re:Electrolysis – run web content in a separate process from... by riquito on Tuesday September 23, 2014 @02:33PM (#8357192)
Thank you for the informations, I'll experiment.
Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @08:45AM (#8350294)
Whichever one it is for chrome I have, it isn't ABP, it's a generic named Adblock. I don't use ABP due to the developer accepting money to whitelist google adverts.
Re:Electrolysis – run web content in a separate process from... by abrowne on Monday September 22, 2014 @10:00AM (#8350553)
If you don't like that behavior, you probably wouldn't like Ablock's either: https://palant.de/2014/07/29/which-is-better-adblock-or-adbl...

(Admittedly the author is biased towards ABP. My biases: former Adblock user, former ABP user, current Adblock Edge and µblock user.)

Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @10:20AM (#8350623)
Thanks. Probably going to evaluate http://alternativeto.net/software/ublock/ instead next time I have to use chrome.
Re:Electrolysis – run web content in a separate process from... by gorhill on Monday September 22, 2014 @12:24PM (#8351223)
AdBlock is significantly worst than ABP memory usage-wise (edit: on Chromium, I didn't benchmark elsewhere). I believe this is also the case CPU-wise from observing Task Manager during benchmarks.
Re:Electrolysis – run web content in a separate process from... by Igglyboo on Monday September 22, 2014 @09:29AM (#8350439)
I have 16GB of ram in my machine, I'd rather use 4 of that for a responsive browser than 1.5 for something that is constantly locking up with more than a few tabs. FF might be better for older, low end machines but now a days low end machines are shipping with 4GB and modest machines will have 8.
Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @10:21AM (#8350634)
In my main rig, I have 8 currently, and would need to replace it all to upgrade (4x 2GB DIMMs) and presently can't afford to build a new one for at least a few months. I do not want a browser to waste 4GB where it would be 1 with all the bloat stripped out.
Re:Electrolysis – run web content in a separate process from... by pbhjpbhj on Monday September 22, 2014 @06:37PM (#8353075)
Whilst you're browsing what are you using the other 7GB for?
Re:Electrolysis – run web content in a separate process from... by ck2 on Monday September 22, 2014 @07:50AM (#8350148)
Except in Firefox, at least for now, you can turn it off and make it monolithic again if that is your desire.

I've had too many stalled pages for my liking so I welcome this when it is finally stable and extensions catch up.

Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @08:09AM (#8350201)
Great, now what happens when they do a google and stealth remove that feature?

(cf: The option to have the tab close button on the right, the status bar, the option to disable javascript, the option to have tabs in a sane place instead of on top...)

Somehow, I doubt disabling multiple processes will be within the scope of an addon.

Re:Electrolysis – run web content in a separate process from... by ck2 on Monday September 22, 2014 @08:17AM (#8350216)
You can switch to Palemoon, Waterfox, Cyberfox, or one of the other forks that still run all the extensions?

Firefox is not for lack of options, I'd say it is the *nix of the browser world.

ps. You can also solve all of the tab issues with TabMixPlus and the UI issues with ClassicThemeRestorer - my Firefox 33 looks virtually identical to Firefox 4

Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @10:23AM (#8350643)
Yeah, I've already done that - Status4Evar, Classic Theme Restorer, Old Location Bar, Switch To Tab No More, Show Go!, etc. My point is I shouldn't need that many addons to get a normal browser out of the mess firefox is becoming.
Re:Electrolysis – run web content in a separate process from... by blinkingled on Monday September 22, 2014 @08:02AM (#8350171)
This makes sandboxing possible which is a huge security win and the reason I still use Chrome where I can. RAM is cheap and browsers 64-bit so a bunch of extra memory in the name of security is not a big deal really. At least that's how I see it.
Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @08:06AM (#8350185)
>RAM is cheap

Great, buy me another 32GB then please</s>. People shouldn't have to have high end gaming rigs to run a sodding browser.

Mozilla (and google) are deluding themselves in thinking that their particular software is the be all and end all of a computer, and should be introduced to this strange concept called 'multitasking'.

Firefox: 1.5GB

Thunderbird: ~1GB

OS: 1GB (conservative estimate)

Various background programs: 1GB

Suddenly doesn't look so cheap.

Re:Electrolysis – run web content in a separate process from... by icebraining on Monday September 22, 2014 @08:28AM (#8350245)
OS: 1GB (conservative estimate)

What are you using, Windows? I'm running Ubuntu 12.04 and the "OS" (X, window manager, daemons) is certainly not even close to 1GB, more like ~100MB.

Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @08:48AM (#8350305)
Windows,and multiple Linux distros. Windows needs >1GB to run smoothly, while most Linux gets by in <1GB, it still feels very sluggish if I can't actually get 1GB when it needs it.
Re:Electrolysis – run web content in a separate process from... by phkahler on Monday September 22, 2014 @09:23AM (#8350417)
I run firefox on Fedora 20, on a dual core AMD64 from 2005. It worked ok with 1GB, but as indicated things went south when it ran out of memory. I upgraded to 2GB and useage rarely goes above 1, so everything is fine now. That said, I'm not one of the people who use tabs instead of bookmarks. My expectations are probably lower than many too, but I am all too familiar with content in one tab destroying performance of the browser as a whole. So I'm all for this e10s thing.
Re:Electrolysis – run web content in a separate process from... by mindcrime on Monday September 22, 2014 @02:43PM (#8351855)
It sucks that you're getting downvoted. I totally agree that this "RAM is cheap" thinking is problematic. Sure, if you only ran one program at a time on a computer, it would make perfect sense. But when I have a finite amount of RAM to spread among a multitude of applications, screaming "RAM is cheap" is bollocks. Never mind that on my current laptop I'm already at the max it can physically support, which means if I want more RAM, I have to buy a whole new machine.

Here's a thought for developers: Next time you find yourself saying "RAM is cheap" (or any variation thereof) thwack yourself about the head multiple times with a big stick, then go rinse your mouth out with soap and water.

Re:Electrolysis – run web content in a separate process from... by possibilistic on Tuesday September 23, 2014 @03:14AM (#8354358)
Sometimes RAM is cheaper than engineer salaries. Sometimes it isn't. It depends on problem domain, scale, and what you're tying to optimize for. Debating this just seems pointless.

In any case, the number one evaluation criterion for browsers is not the RAM profile.

If performance matters that much, perhaps you should instead be asking why we are writing applications and UI in an ugly evolution of SGML.

Before you fault the Moz devs, ask yourself why we have CSS for high DPI images and why designers embed videos into website headers. Maybe your needs aren't at all times reflective of the majority. The browser serves the spec. The spec serves every case you care to imagine. Because that's what we evolved a doc format to do.

(Just imagine a parallel universe where it was instead MS Word that evolved into a facebooking client!)

Re:Electrolysis – run web content in a separate process from... by mindcrime on Tuesday September 23, 2014 @04:34PM (#8358021)
I'm not faulting the Moz developers per-se, just saying that - as a group - developers should not just throw up their hands, shout "RAM is cheap" and then be totally cavalier about how their programs use RAM. It's a refrain that has become, IMO, all too common, and I think it's harmful.

Sure, Firefox, and every other program should use as much RAM as it needs. But we should be mindful of keeping that need as low as possible, at least for any program that falls into the category of "runs in a multi-program environment and probably won't be the only program running from a finite RAM pool".

Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @09:58AM (#8350542)
I'm curious how huge of a security win it really is. The vast majority of exploits that I hear about would still be possible. Especially since phishing is by far the weakest link in any model.

I mean, sure, it sounds great to say things are sandboxed. But when the actual exploits either a) root the machine, or b) targeted the user directly, it seems that protecting tabs from each other really doesn't do much.

Re:Electrolysis – run web content in a separate process from... by icebraining on Monday September 22, 2014 @10:11AM (#8350597)
It's not about protecting the tabs from each other; when you separate the tasks into different containers, you can apply strong limits to what each can do, which makes it harder to "root the machine".

For example, see the Chromium docs: http://www.chromium.org/developers/design-documents/multi-pr...

Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @11:32AM (#8350959)
I see, this is more about sandboxing the renderer. Not necessarily sandboxing the tabs. Right? Curious if one really required the other.

And, still, kind of amusing that the entire point of the browser is that it is sandboxed from the whole computer. Seems if we just restricted what the browser was capable of as a whole, we'd be there.

Re:Electrolysis – run web content in a separate process from... by agwa on Monday September 22, 2014 @11:57AM (#8351086)
Trying to restrict the browser as a whole doesn't work for a couple reasons:

1. The browser as a whole needs to have permission to do quite a few things, including reading from and writing to the filesystem (for uploading and downloading files), talking to your system's graphical environment so it can display windows, and accessing arbitrary hosts on the network so it can access web servers. It's just not possible to meaningfully sandbox something requiring so much access. Individual browser components, on the other hand, can be designed to do very specific tasks and are thus easier to isolate.

2. You want to protect not only your system from a browser exploit but also other parts of the browser. A site that exploits a browser vulnerability shouldn't be able to read your cookies for another site.

These reasons imply that you need to focus on isolating and restricting components inside the browser instead of the browser as a whole.

Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @12:04PM (#8351122)
Your last sentence is a better worded version of what I meant. That it is less that the tabs are isolated and sandboxed, and more that components of the browser are.
Re:Electrolysis – run web content in a separate process from... by icebraining on Monday September 22, 2014 @12:03PM (#8351117)
If you sandbox the whole browser, it can't actually do anything, including actually display the webpages or connecting to sites.
Re:Electrolysis – run web content in a separate process from... by blinkingled on Monday September 22, 2014 @10:53AM (#8350776)
It is way harder to exploit a machine through a properly sandboxed process. Sandboxing restricts the process's access to filesystem and network. On Linux for example seccomp can restrict the number of system calls the process can make which further reduces the attack surface greatly. So to exploit a OS vulnerability through a sandboxed process you also need to exploit a vulnerability in sandboxing itself. That's significant.
Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @08:06AM (#8350188)
I think performance is often overblown on this as well. However, I don't think the overhead from task switching will really enter into it. If you have hundreds of tabs open that are trying to do work, that is work that was having to be done regardless. Meaning they would already be thrashing. Now, that will just be in a different way.

Otherwise, if you are idling most of those processes, they should be the same as before. Just idle.

Memory, on the other hand, I think will go up. Not sure by how much, though. I would think the rendered content would be the largest consumer of memory. And again, if you have hundreds of tabs open with high memory usage per tab, that should already be a problem. Right?

Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @08:08AM (#8350198)
Firefox: Averages ~5MB/tab (200 tabs, 1GB memory)

Chrome: Anywhere from 50MB/tab up.

A much better performance fix would be to suspend javascript execution on tabs that aren't visible.

Re:Electrolysis – run web content in a separate process from... by jgraham on Monday September 22, 2014 @01:34PM (#8351534)
Talking about "memory usage per tab" doesn't make much sense unless you talk about what's in the tabs. It's rather like talking about "memory usage per application" on your desktop and not mentioning whether the application is ed or OpenOffice.

Suspending JS execution in invisible tabs seems highly unlikely to be web-compatible; you wouldn't want YouTube or Spotify to stop playing just because you focused a different tab. On the other hand, with technologies like requestAnimationFrame, we can make it possible for well designed applications to work well when in the background.

Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @09:52AM (#8350520)
Right, this is just memory, though. And I am curious on whether or not this counts shared memory correctly between tabs.

My point for performance, though, was mainly that if you have 200+ tabs that are actively doing something, then you are thrashing even in firefox. It isn't like they just do their work for free depending on the process model.

Also, 200 is not exactly a large N when we are too worried about scheduling, is it? (That is, unless all 200 are cpu bound, in which case, again, firefox would already be thrashing.)

Re:Electrolysis – run web content in a separate process from... by tonyplee on Monday September 22, 2014 @11:35AM (#8350980)
Hmmm, I have 10 tabs now and Mac's "Activity Monitor" shows FF is using 571MB of RAM.

Not sure about the ~5MB/tab figure.... This is FF 32.0.

Re:Electrolysis – run web content in a separate process from... by lern_too_spel on Monday September 22, 2014 @11:25AM (#8350914)
On Chrome, the OS can page all those other tabs to disk without affecting performance of the current tab. On Firefox, you're going to feel it.
Re:Electrolysis – run web content in a separate process from... by umanwizard on Monday September 22, 2014 @11:51AM (#8351062)
Why can't the OS page Firefox's memory to disk too? Paging is done at much finer granularity than per-process.
Re:Electrolysis – run web content in a separate process from... by lern_too_spel on Monday September 22, 2014 @12:27PM (#8351244)
Because, as I said earlier, "you're going to feel it." If your tabs are allocating in the same process address space as each other, accessing your current tab's data is likely to cause swapping. The key point is that electrolysis and chromium-based browsers can page inactive tabs "without affecting performance of the current tab."
Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @12:41PM (#8351305)
This isn't really intuitive, though. When you switch to a tab, either you page in that tab's memory for the current process. Or you page in that tab's process and memory.

That is, by going to a "per process" approach, the amount of memory that gets paged in almost certainly went up. No?

Re:Electrolysis – run web content in a separate process from... by lern_too_spel on Monday September 22, 2014 @01:04PM (#8351385)
The amount of memory that gets paged in went up, but the whole point is that you never have to page any of the current tab's memory while you're using it, unlike with the monolithic 1 GB Firefox process today.

I feel like I must not have been clear earlier because I have made just a single point, and both of you are discussing things not related to that point. Let me try one more time: it's all about performance of the current tab.

Re:Electrolysis – run web content in a separate process from... by umanwizard on Monday September 22, 2014 @01:52PM (#8351601)
I still don't see the scenario you're describing, though. Let's say you have two tabs open, A and B. Then some set of pages will have memory for A, and some set will have memory for B. If you're not using A, then the operating system will notice that those pages have not been used in a while and if under memory pressure it will page them out. This won't affect pages with memory for B.

The only issue would be if most of the memory allocations are under your system's page size (typically 4096 bytes) and distributed randomly, so that a lot of pages have data structures associated with multiple different tabs. But I think that's unlikely, and even if it is true, couldn't it be resolved by making your allocation strategy tab-aware (e.g., by giving each tab its own malloc arena, which would be way simpler than splitting the browser into multiple processes).

Am I missing something here?

Re:Electrolysis – run web content in a separate process from... by lern_too_spel on Monday September 22, 2014 @04:29PM (#8352427)
You get it. The one thing you're missing is that application-aware allocation is hard and something that Firefox engineers continuously have to work on (http://blog.pavlov.net/2007/11/10/memory-fragmentation/), even as they add new features and performance caches. The electrolysis/chromium solution makes the problem disappear entirely (along with some security problems) without any possibility of regression.
Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @01:18PM (#8351457)
Right, and the counter point is that this should not help there. If the other tabs are idle, than they are idle whether in process or not. If they are all cpu bound doing stuff, then your machine is again in trouble, current process or not. If they are all constantly thrashing in resources, you are still in trouble.

Why would you think the current monolithic would page out a tab that was actively being used? Why would this not also happen in the "per process" approach?

That is, how would this specifically help? If you are actively using the memory for the current tab, because it is the current tab, why would it be swapped out under the monolithic case where it would not in the per process case?

I'm perfectly willing to accept there is a scenario I am not considering. I just don't see it, right off.

Re:Electrolysis – run web content in a separate process from... by lern_too_spel on Monday September 22, 2014 @04:10PM (#8352337)
Because the tab you're using has barfed its data all over the heap, so you can't keep all its data paged into main memory. Its data is mixed together with the other tabs' data.
Re:Electrolysis – run web content in a separate process from... by taeric on Monday September 22, 2014 @04:42PM (#8352519)
At face value, I don't see why this should necessarily be the case. That is, why would a tab "barf its data all over the heap?" More directly, why couldn't, as the sibling said, this have been addressed with a different allocation mechanism.

I'm assuming this has come up a fair bit. Any good links to read up on this?

Re:Electrolysis – run web content in a separate process from... by hippich on Monday September 22, 2014 @08:23AM (#8350232)
I am not questioning reasons to have 200 open tabs, but wonder how do you manage it? I would imagine tab bar become very long?
Re:Electrolysis – run web content in a separate process from... by JackC on Monday September 22, 2014 @08:52AM (#8350315)
With high-res, widescreen monitors, it makes a lot more sense to have tabs in a vertical stack. Check out Tree Style Tabs for Firefox: https://addons.mozilla.org/en-US/firefox/addon/tree-style-ta...

This is the must-have feature that keeps me using Firefox -- especially when I'm doing research, which has a naturally tree-like pattern. Apparently, from the Chromium bug, it's a dealbreaker for lots of other people as well: https://code.google.com/p/chromium/issues/detail?id=344870

Re:Electrolysis – run web content in a separate process from... by mmebane on Monday September 22, 2014 @08:44AM (#8350291)
The Tree Style Tab extension [1] makes a world of difference here. My tab bar basically becomes a stack of ephemeral bookmarks.

[1]: https://addons.mozilla.org/en-US/firefox/addon/tree-style-ta...

Re:Electrolysis – run web content in a separate process from... by adamtulinius on Monday September 22, 2014 @08:28AM (#8350246)
It helps that Firefox offers to change to an existing tab when you try to open the same page in a new tab.

Another suggestion is to not manage it. I create tabs all the time, and often have many similar tabs. There's no need to manage it, only to clean up once in a while.

(I like many tabs. A few weeks ago I performed some tab-cleaning -- 550 tabs were a bit much, as it made Firefox start slower.)

Personally i just use it for things I would like to read at some point, instead of filling up my bookmarks with 50-10 entries every day.

Re:Electrolysis – run web content in a separate process from... by blueskin_ on Monday September 22, 2014 @08:47AM (#8350296)
>It helps that Firefox offers to change to an existing tab when you try to open the same page in a new tab.

Disabled that as soon as it was dumped on me. There are an almost infinite list of reasons to have multiple copies of tabs.

Honestly, I cleanup every week or two, and it works fine. Windows are by category of different things I do, and I tend to leave frequent sites open all the time.

Re:Electrolysis – run web content in a separate process from... by daxelrod on Monday September 22, 2014 @02:53PM (#8351921)
The TabPolish Chrome extension implements similar behavior (in a slightly different way; it doesn't hook into the suggestion menu, and duplicate detection is per window, rather than per browser instance).

I find it essential to manage the mess that is my Chrome tabs.

Re:Electrolysis – run web content in a separate process from... by silon3 on Monday September 22, 2014 @09:27AM (#8350434)
I wish it had an option to reorder that tab (move it to end / bottom in TreeStyleTabs). (also, reverse order of tabs in TreeStyleTabs would be great).
Re:Electrolysis – run web content in a separate process from... by ANTSANTS on Monday September 22, 2014 @09:04AM (#8350350)
I deal by creating multiple windows, ideally one per general topic/use case. This works great with Chromium because you can easily drag multiple tabs between windows to organize things, and the shrinking tab bar encourages you to close things you don't need. Doesn't work so well in Firefox, where you have to manually drag each tab over one by one, doing so is kinda glitchy, and the scrolling tab bar makes it easier to just fill a window with a ton of unrelated tabs.
Re:Electrolysis – run web content in a separate process from... by icebraining on Monday September 22, 2014 @09:20AM (#8350409)
Re:Electrolysis – run web content in a separate process from... by sergiosgc on Monday September 22, 2014 @12:16PM (#8351190)
Although I don't get anywhere near 200 tabs, I hit the same type of UI management issue. I use contextualized "sessions" using panorama in Firefox (Ctrl-Shift-E). I have 10-20 tabs per context, and somewhere between 6 and 10 contexts. Between Panorama and TreeStyle tabs (a plugin), everything is neatly organized.

Panorama is a life-saver if you have to context-switch between projects regularly.

TreeStyle, really, I use more as a means to move screen real-estate to horizontal usage on my laptop's 16:9 screen. Tab organization is a side benefit.

Re:Electrolysis – run web content in a separate process from... by gorhill on Monday September 22, 2014 @12:28PM (#8351246)
In the big picture, sandboxing may actually help memory consumption in the long run. When a tab close, a process close, and the OS ensure that all memory for that process is freed as well.