Firefox 4.0 alpha 2 brings out-of-process plugins

Mozilla has been hard at work since releasing the first alpha of Firefox 4.0 (which is still named 3.7 for some reason). Similar to Chrome and Internet Explorer 8, which separate tabs into different processes, Mozilla has been planning on separating tabs, as well as add-ons, in the same way. The idea, as a whole, is being called "Electrolysis" and will be one of the most important features of Firefox 4.0.

Mozilla has released a second developer preview of Firefox 4.0 which contains a piece of the Electrolysis project. Dubbed "Out-of-Process Plugins," the new feature will ensure that plugins don't bring down the entire browser. When a plugin, such as Flash, crashes, the user's session will stay intact, leaving the plugin to be dealt with on it its own. Firefox will terminate the problematic plugin and then restart it automatically. The browser will also display a nice little error message, telling the user to refresh the page (see below). Some of the other performance improvements found in the new alpha release are:

  • Link history lookup removed from main thread and made asynchronous
  • Loading HTML5 spec no longer causes long pauses
  • Layout performance improvements (DOM access time, color management, text area, etc.)
  • JavaScript engine improvements (better string handling, faster closures, support for recursion)
  • Many new features for developers

If you want to test run Firefox 4.0 alpha 2, use the links below. Keep in mind that this is a very early preview and should not be used as your primary browser.

Firefox 4.0a2 Plugin Crash

 

Report a problem with article
Previous Story

Nexus One has a major multitouch problem

Next Story

NVIDIA Forceware 196.75 WHQL

58 Comments

Commenting is disabled on this article.

Other than Flash I haven't had any addons crash, and then I just end the flash process, but whatever. I suppose it can't be bad to have.

Bring back a sane address bar, and I might care. Old Location Bar add-on functionality should just be built in to the options by default. Why they ever changed this so drastically, left NO option to revert, and belittled people for saying it sucked, is beyond me. Some serious attitude there, which I did not appreciate from the FX folks.

Anyway, good to know they're trying to improve things.

Flash sucks, everyone knows it, especially for video. It is so terrible for video that I still can't believe it's so popular. Just because it's simple doesn't make it worth anything... Real video codecs are far better for video, and Flash just sucks, period. Perhaps if enough people report enough crashes related to it, Adobe will be forced to improve it and consider optimizing the whole thing to not suck so badly.

Wasting CPU cycles, bus traffic, and totally irrelevant resources is not how to handle media. There have been very well established ways to do these things for AGES, and Flash manages to ignore those things and try to funnel media through its mess of code. Sad.

Good for the Firefox folks for continuing to work on ways to improve things.
Please put an option in for making auto-complete sane again, like it was in 2.x, thank you.

Sometimes (if not always) the guilty behind the flash crash is not Adobe by the video graphics manufacturer (intel, ati and nvidia).

~Neowin~ said,
Any improvement in Acidtest3 score? Is the gif animation bug of Fx3.6 got fixed?

nah, but performance is improved by 20%, another 40% will make it as fast as Opera 10.5 in Peacekeeper benchmark

I never had any problem with Flash crashing the browser, but I had other plugins that were crashing the browser (old corporate plugins that weren't updated and form which I couldn't find a newer version).

That should help to avoid bringing down the whole browsing session.

IMO , there is no point to not to use a Nightly , they are really stable and with Nightly Tester Tool u can run all those addons. Plus, if u have compatibility issues with some sites , then go to about config and change value of [i]general.useragent.extra.firefox[/i] as Firefox 3.6. Done!

BTW check out performance of Firefox 3.7 Alpha 3 , its as fast as Safari 4 and just 40% slower than Opera 10.5 (1.4 times)

http://clients.futuremark.com/peacekeeper/results.action?key=34Ns

For now i would just enable DirectWrite because D2D seems to make it take for ever to start. Write however makes page rendering a lot faster :)

Jack E said,
For now i would just enable DirectWrite because D2D seems to make it take for ever to start. Write however makes page rendering a lot faster :)

DirectWrite without Direct2D has a overhead, it's actually a bit slower than plain GDI rendering.

You have to follow these steps if you want to enable D2D and DirectWrite at the moment: http://forums.mozillazine.org/viewtopic.php?f=23&t=1775755

Jack E said,
You have to follow these steps if you want to enable D2D and DirectWrite at the moment: http://forums.mozillazine.org/viewtopic.php?f=23&t=1775755
It's not in alpha 2 afaik, came directly after.

Edited by Kirkburn, Mar 4 2010, 2:59am :

"which separate tabs into different processes"
YES! what a genius move!. Now you will use the whole 4GB of memory JUST browsing... Its no enough that the OS take your memory caching but now a browser(s).

ThePitt said,
"which separate tabs into different processes"
YES! what a genius move!. Now you will use the whole 4GB of memory JUST browsing... Its no enough that the OS take your memory caching but now a browser(s).

WTF? The overhead of running a separate process is a few kilobytes of RAM, and some extra CPU time for switching+signaling.

Unless you're currently coming to within a few kilobytes of 4GB of memory when running Firefox currently, then the difference will be negligible. It might even improve, when the code for communicating with plugins is cleaned up.

cyberdrone2000 said,

WTF? The overhead of running a separate process is a few kilobytes of RAM, and some extra CPU time for switching+signaling.

Unless you're currently coming to within a few kilobytes of 4GB of memory when running Firefox currently, then the difference will be negligible. It might even improve, when the code for communicating with plugins is cleaned up.

More like few megabytes, each process would need its own engine as I understand it.

Besides, how would cache work then? Wouldn't that break FF's ability to run RAM-only?

Udedenkz said,

More like few megabytes, each process would need its own engine as I understand it.

Besides, how would cache work then? Wouldn't that break FF's ability to run RAM-only?

Taking flash as an example... it wouldn't need anything more than it already has. A render target, defined on the screen as the area in the browser... and an input file + parameters. I don't see how some other kind of engine would be needed... Besides, a model like this would see enormous speed benefits from the GPU-accelerated rendering...

And if it is a couple of megabytes... so? Firefox takes up ~150mb idle (with plugins, themes, etc.)... taking the plugins out of the browser would see a major increase in responsiveness of the browser itself (not to mention the JS engine). Let's say a running flash movie takes ~50mb in the browser, and 2mb for process overhead when running as a standalone process... on a system with 4096MB! The speedup in the browser engine itself will be well worth it.

Stop crying over two megs of RAM... it's cheap these days! Throw in a 2-gig stick for $49.99.

Udedenkz said,

More like few megabytes, each process would need its own engine as I understand it.

Besides, how would cache work then? Wouldn't that break FF's ability to run RAM-only?

Chrome has done this, and it hasn't been a memory hog... I see no reason to expect much memory usage...

Udedenkz said,

Besides, how would cache work then? Wouldn't that break FF's ability to run RAM-only?

The parent process should be able to house the RAM based cache. Anyway, if you're worried about a few MBs, why exactly are you using a RAM only cache? :P

cyberdrone2000 said,
Taking flash as an example... it wouldn't need anything more than it already has. A render target, defined on the screen as the area in the browser... and an input file + parameters. I don't see how some other kind of engine would be needed... Besides, a model like this would see enormous speed benefits from the GPU-accelerated rendering...

They're currently using a shared memory segment between the child and the host to do windowless plugins. There's some overhead, but not very much (even a large plugin has a fairly low overhead, a 1280x720 plugin "window" would use 3.51MB of memory in total for both processes). So yes there's some overhead, but decoupling plugins from the browser results in stability and responsiveness improvements, which I think is an acceptable trade off.

Also, add in the eventual Layers work they're doing, and each plugin will render to a segment of memory which will either reside in VRAM or be copied to it, then composited on the GPU with the rest of the web page. On OS X a plugin (say, Flash) could use Core Animation, which could render natively to an OpenGL surface owned by Firefox which is then composited together with the rest of the page, done properly it could remove any performance issues.

Udedenkz said,

More like few megabytes, each process would need its own engine as I understand it.

If Firefox uses DLLs to do its rendering, then no, it would only have to have one copy in memory.

ThePitt said,
"which separate tabs into different processes"
YES! what a genius move!. Now you will use the whole 4GB of memory JUST browsing... Its no enough that the OS take your memory caching but now a browser(s).
It's not really that bad. Chrome consumes about 10 MB/tab when I run it here and now, and then like 50-100 MB for the browser process itself. This adds up to around 150-200 MB for 10 tabs, which is some 50 MB above non-separated usage, but as a bonus you get each tab more secure and also split up across your CPU processor cores for faster performance. One inactive tab with Flash on won't necessarily slow down all other tabs anymore.

Edited by Northgrove, Mar 4 2010, 8:07am :

Northgrove said,
It's not really that bad. Chrome consumes about 10 MB/tab when I run it here and now, and then like 50-100 MB for the browser process itself. This adds up to around 150-200 MB for 10 tabs, which is some 50 MB above non-separated usage, but as a bonus you get each tab more secure and also split up across your CPU processor cores for faster performance. One inactive tab with Flash on won't necessarily slow down all other tabs anymore.

I think firefox WILL allow us to choose between both modes via about:config , so we have actually have a benchmark then

cyberdrone2000 said,

WTF? The overhead of running a separate process is a few kilobytes of RAM, and some extra CPU time for switching+signaling.

Unless you're currently coming to within a few kilobytes of 4GB of memory when running Firefox currently, then the difference will be negligible. It might even improve, when the code for communicating with plugins is cleaned up.


you havent seen the HUGE memory and CPU usage increase the past several FF versions? its not even funny.

leave FF and IE on for a day, same ammount of tabs and same websites openend. guess who wins in speed and resource usage? You might be shocked as IE is a clear victor. FF over 700mb usage (real usage, including cached RAM) and IE using as much as 70MB... FF with a constant 40-50% CPU usage and IE with a CPU usage that hoovers between 1-15%.....
And no, i've tested it under 64bit win7 and 64bit ubuntu, the FF resource usage is very...very similiar on both, so dont playt he blaim MS game =)

Every upgrade of FF i start to dislike it more, i dont like closing things, like an OS, programs should also be self sufficient, cleaning up their own mess, no need to restart applications because it cant clean up.

having 2 FF windows with 7 tabs in one and 2 tabs in the other, using 753MB ram is just CRAZY!!! its displaying a few kb of web material, including flash, maybe 2 mb of data to display, and using 300times as much RAM, something is wrong with resource usage in FF

Diacon said,

you havent seen the HUGE memory and CPU usage increase the past several FF versions? its not even funny.

leave FF and IE on for a day, same ammount of tabs and same websites openend. guess who wins in speed and resource usage? You might be shocked as IE is a clear victor. FF over 700mb usage (real usage, including cached RAM) and IE using as much as 70MB... FF with a constant 40-50% CPU usage and IE with a CPU usage that hoovers between 1-15%.....
And no, i've tested it under 64bit win7 and 64bit ubuntu, the FF resource usage is very...very similiar on both, so dont playt he blaim MS game =)

Every upgrade of FF i start to dislike it more, i dont like closing things, like an OS, programs should also be self sufficient, cleaning up their own mess, no need to restart applications because it cant clean up.

having 2 FF windows with 7 tabs in one and 2 tabs in the other, using 753MB ram is just CRAZY!!! its displaying a few kb of web material, including flash, maybe 2 mb of data to display, and using 300times as much RAM, something is wrong with resource usage in FF

hmm... maybe you have not been running the latest stables? They are pretty good with memory consumption IMO (keep in mind Digg is a JS-intensive website):
http://imgur.com/YHMTs

Edited by advancedboy, Mar 4 2010, 2:59pm : hotlinking was not meant to be :C

Diacon said,
having 2 FF windows with 7 tabs in one and 2 tabs in the other, using 753MB ram is just CRAZY!!! its displaying a few kb of web material, including flash, maybe 2 mb of data to display, and using 300times as much RAM, something is wrong with resource usage in FF
Sounds like you have something wrong with your install, tbh. Extensions, or corruption, I don't know ... but that ain't normal.

Udedenkz said,

More like few megabytes, each process would need its own engine as I understand it.

Besides, how would cache work then? Wouldn't that break FF's ability to run RAM-only?

Shared Memory is your friend....

Udedenkz said,
Not as relevant as D2D accell. Works for all non-legacy GPUs. :D

Hardware acceleration is great (especially for smooth text rendering), but this is definitely a more important feature in the long run. :P This feature means they can finally make a 64-bit version of Firefox without caring about what Adobe, Microsoft, or other plugin vendors do.

Edited by Elliott, Mar 4 2010, 4:33am :

The article is incorrect. Out-of-process plugins was in Firefox since 3.7a2pre and is correctly being backported to Firefox 3.6 as a minor release codename "Lorentz". Firefox 4.0 will separate each tab into separate process.

Even better, the alphas now clean up behind themselves properly (something alphas of Firefox typically have issues with). I installed alpha 2 (without uninstalling alpha 1 first), and it both remembered my settings from alpha 1 and *silently uninstalled it*. It also imported my tabs from my last (alpha 1) session (including the old posting on Neowin regarding alpha 1 availability).
While it won't replace IE on Windows, it is clamping down hard on second place there (and remains in the lead on Linux distros)

PGHammer said,
Even better, the alphas now clean up behind themselves properly (something alphas of Firefox typically have issues with). I installed alpha 2 (without uninstalling alpha 1 first), and it both remembered my settings from alpha 1 and *silently uninstalled it*. It also imported my tabs from my last (alpha 1) session (including the old posting on Neowin regarding alpha 1 availability).
While it won't replace IE on Windows, it is clamping down hard on second place there (and remains in the lead on Linux distros)

Wow, that's great. I haven't used the Beta's, but that would be an important feature I would say...

finally, when something crashes it doesnt take the whole browser with it and people can finally blame the plug-in directly and not the browser

neufuse said,
finally, when something crashes it doesnt take the whole browser with it and people can finally blame the plug-in directly and not the browser

Yes, absolutely. This is really great. I'm REALLY looking forward to Firefox 4.0, it sounds like they have some REALLY good improvements planned...

mystmaster23 said,
yay for a GIANT jump in memory and cpu usage!

If it's "giant", they're doing it wrong. Either way, the minor CPU usage hit and memory waste you get is the price you pay for improved stability. Not to mention the security benefits.

Edited by Mordkanin, Mar 4 2010, 12:19am :

mystmaster23 said,
yay for a GIANT jump in memory and cpu usage!

Well, it's still Alpha... Hopefully Mozilla will optimize this further in future releases... I don't see why it *should* cause so much CPU usage...

mystmaster23 said,
yay for a GIANT jump in memory and cpu usage!

CPU usage should be practically the same. There'll be some slight memory overhead, but I think with the proliferation of web apps that demand stability, a few MBs of RAM is a small price to pay.

Elliott said,

CPU usage should be practically the same. There'll be some slight memory overhead, but I think with the proliferation of web apps that demand stability, a few MBs of RAM is a small price to pay.

Absolutely. +1.

Elliott said,

CPU usage should be practically the same. There'll be some slight memory overhead, but I think with the proliferation of web apps that demand stability, a few MBs of RAM is a small price to pay.
I'm not sure what you're meaning will bring the stability for the RAM cost here? The out-of-process plugins? But when talking web applications, it usually means stuff built on the web, not Flash and so on. Hence why JS and DOM performance, and HTML 5 support, is important for web apps. For Flash none of this would matter at all.

Edited by Northgrove, Mar 4 2010, 8:15am :

mystmaster23 said,
yay for a GIANT jump in memory and cpu usage!

Sometime i'm really wondering what PC the average neowin user has. Each post there's always this guy complaining about flash using all the power of his computer or firefox using all the memory of his computer.

I have a fairly average PC. A good one yes but not top of the line. Core I5. 4GB of normal ram. Good one but nothing to write home about.

Flash never ever use more than 10% of my CPU. Never. Never flash will slow down my computer a little bit even if wow is opened in the backgound, wmp play music and i have a couple of tab opened.

Firefox yes after a while will use a good chunk of memory. So is IE and other browsers when i open lot of tabs.

I mean what computer do you have. An old Pentium 200 mmx with 32MB ram ?

Edited by LaP, Mar 4 2010, 3:07pm :

Elliott said,

CPU usage should be practically the same. There'll be some slight memory overhead, but I think with the proliferation of web apps that demand stability, a few MBs of RAM is a small price to pay.

i don't think so. For instance, if i use a plugin then this plugins must be running in all separated process and it is expensive.

LaP said,

Sometime i'm really wondering what PC the average neowin user has. Each post there's always this guy complaining about flash using all the power of his computer or firefox using all the memory of his computer.

I have a fairly average PC. A good one yes but not top of the line. Core I5. 4GB of normal ram. Good one but nothing to write home about.

Flash never ever use more than 10% of my CPU. Never. Never flash will slow down my computer a little bit even if wow is opened in the backgound, wmp play music and i have a couple of tab opened.

Firefox yes after a while will use a good chunk of memory. So is IE and other browsers when i open lot of tabs.

I mean what computer do you have. An old Pentium 200 mmx with 32MB ram ?

For starters, a Core i5 is in no way an average PC. For everything below a Core i5 (I have never actually used a machine with a Core i3-i7 other than one's on display at stores), Flash will eat up 100% of a single core, at a minimum while it is running anything even remotely animated. I'd be shocked if the Core i5 faired better, considering that Flash is simply unoptimized software. Maybe the Core i5 just beasts through it.

As for memory usage, Firefox has been known to have a memory leak somewhere, and for a long time. Whenever I use it (currently, a Chrome user) and leave it open for a long time, then it quickly becomes the dominant memory eater. Separating tabs into processes, the memory leaks would be contained within each process and taken care of by the OS when it cleans up the process (as the tab is closed). While true, this would mean more memory is being used overall, at peak times if you leave all of the tabs open (compared to a single process, tab manager), but the trade off with cleanup, and especially crash stability is well worth it to most people, including myself. Flash is the prime crasher of Firefox, for me, and it regularly crashes in Chrome (though I do regularly wonder if Chrome has something to do with that because it happens /so/ frequently).

I believe this is Firefox 3.7. They are planning such a minor release, which will include Out-of-process plugins: https://wiki.mozilla.org/Firefox/Roadmap (details at the bottom). Note that the build number also has Gecko version 1.9.3.

Looks to me like the tabs don't get separated into different processes until 4.0. That won't be until Gecko version 1.9.4.

inarius said,
I believe this is Firefox 3.7. They are planning such a minor release, which will include Out-of-process plugins: https://wiki.mozilla.org/Firefox/Roadmap (details at the bottom). Note that the build number also has Gecko version 1.9.3.

Looks to me like the tabs don't get separated into different processes until 4.0. That won't be until Gecko version 1.9.4.

OOPP is planned to be backported to the 3.6.* branch eventually.

inarius said,
I believe this is Firefox 3.7. They are planning such a minor release, which will include Out-of-process plugins: https://wiki.mozilla.org/Firefox/Roadmap (details at the bottom). Note that the build number also has Gecko version 1.9.3.

Looks to me like the tabs don't get separated into different processes until 4.0. That won't be until Gecko version 1.9.4.


Yes, I also think so. There's supposed to be precisely this thing about OOP *before* Firefox 4 as an interim release. I wish the editor wouldn't assume things and just go with the released info by Mozilla.