Memory Usage of Chrome, Firefox 3.5, et al.
An anonymous reader writes "This experiment graphs the memory usage of Chrome and Firefox 3.5 (along with Safari and Opera) over a series of 150 Web page loads using an automated script. Firefox 3.5 shows the lowest memory usage in all categories, including average memory usage, maximum memory usage, and final memory usage. Chrome uses over 1 GB of memory due to its process architecture. Safari 4 and Opera show memory usage degradation over time, while Chrome and Firefox 3.5 are more reliable in freeing memory to the OS." IE 8 was not included "because the author could not find a way to prevent it from opening a new window on each invocation of the command."
Summing the memory usage of all the Chrome processes is probably not the correct thing to do, as the memory usage indicated most likely includes shared libraries. I can't say this for sure about Vista, but on all sane operating systems, each shared library is loaded only once into memory, and then shared among different running programs.
It's not just firefox either. Over the last couple weeks /. has been a major pain to read via I.E. 7 (what I'm stuck with at work) Opera (9.6 and 10 beta) and with Firefox.
/. as one of my always open tabs in Opera, but until the last couple days, I've been choosing otherwise, simply because /. was bogging down the entire browser even while I was off reading other tabs. But today, and now that I think of it yesterday as well it was not nearly as annoying.
The symptoms are not identical on all three browsers but none of the three has been working like it used to do.
Although it does seem like it's been better the last day or two.
I usually have
IIRC its possible to instruct Chrome to not use its process-per-tab model via a command line option. Can't remember what it is, but I remember reading it existed. It seems likely that Chrome would have used less memory when running in that mode.
I'm glad to hear that Firefox has finally improved its memory usage. Although my system has plenty of memory, I still find that the amount of memory FF3 requires causes a very annoying slowdown.
Of late, I've been using Midori as an alternative. With it's current git version and a recent WebKit build (r44951), I've found it to perform better than any other browser I've used (opera, konqueror, firefox). Although it does have a few minor kinks, it supports pretty much every site I've come across and works considerably better with mozilla plugins (namely, flash) than Konqueror and Opera.
Currently with an instance I've been using for the last few days, Midori is using 77 MBs of memory (for comparison, my other running browsers: opera- 120 MBs, Konqueror- 91 MBs, Firefox- 119 MBs). I didn't do any even moderately sophisticated benchmarks suck as those in the article, but that beats the average and final amounts of memory of FF3.5 as shown in the article. Obviously this is not Windows-friendly, but I'd say Midori deserves some more attention, considering that (for me, at least) it outperforms all the other major browsers.
I use Firefox and Safari regularly. I use two web browsers because each one does something vastly better than the other. Firefox for porn and online transactions, Safari for basic day-to-day anything that might include bookmark management... When the system is shitting gold plated bricks trying to deal with the demands After Effects or Photoshop or Final Cut Pro is putting on it, Safari is beyond useless... and Firefox is responsive.
So, you watch porn whilst using Photoshop or Final Cut Pro?
Something like "it doesn't show weird ass icons and bars when Slashdot decides to change CSS" is probably much more important. Firefox 3 totally screws up Slashdot in Default mode.
Being as I get the exact same behavior on firefox (3.0.11), IE (6, 7, and 8), safari, and opera, I somewhat doubt it's firefox's fault.
upon the advice of my lawyer, i have no sig at this time
The report doesn't consider plugins, which are the things that I think most people identify with Firefox feeling bloated or memory heavy. Vanilla Firefox may very well be light on memory, but once you load in a handful (or a few dozen) of your favorite plugins, the tests may not turn out the same.
Keep in mind, I am not attempting to imply that the results would certainly be worse, just that they are currently unknown to us and that it's something that needs to be considered.
Some of those "trolls" weren't about memory usage, but about overall degradation of user experience over time (hey, I have tons of memory, apps should use it).
I used Phoenix/Firebird/Firefox almost since its inception, plus functionality of few nice plugins isn't implemented in Opera (vast majority of features/plugins that, according to claims, keep people on Firefox, actually are), but the latter is the only browser which doesn't force me into managing it / using it in a particular way just so it remains usable (Chrome comes close to it, technically, but it lacks features; IE is of course even worse; didn't really try Safari; and what's funny...Mozilla Suite/Seamonkey is noticeably better than "leaner" Firefox)
As a matter of fact...Firefox 2.x was much better than 3.x (I check it every few months) when it comes to UI remaining responsive/etc. under heavy usage; which causes me to suspect they overshoot with memory usage reduction, missed that sweet spot of amount of memory required by particular codebase to work properly (and Gecko has it higher than others - how many years are we waiting for mobile version? Will it work on my 230MHz AMR phone with 12MB of user RAM? (Webkit and Opera do...))
One that hath name thou can not otter
It's 3.0, 3.5 has a new icon.
New things are always on the horizon
If you are trying to explain the mechanism to a layman, you need to steer clear of terms like "processes" and "threads" as part of the explanation.
Imagine the memory in your computer is like a housing development. At first, there is a lot of open space. The open space can be partitioned so that houses can be built. Each of those houses represents a process. As long as you have more space, you can build more houses.
Inside each house, you have rooms. In computer terms, these would be threads. Each room has a specific job - kitchen, bedroom, bathroom. Sometimes you need more rooms, so you have to build them. This may mean that the size of the house needs to grow, and the amount of acreage the house needs must grow with it.
As long as a house exists, it will continue to occupy the space it is on. In computer terms, the process will hold on to the memory it has already claimed. However, the corollary to this is that when the house is torn down, all the land it occupied is returned to the "free acreage".
If a room is remodeled, it will not result in a change to the actual house size. Adding more rooms will always take up more land, but removing those rooms doesn't change the occupied land size at all.
In the same way, a process can grow and grow, but as soon as it completes (you close a tab in the browser), the memory will go back to the operating system so other processes can use it. But if the process does not complete because it uses threads to build those same tabs, then the process will continue to take up that memory.
Also consider that a house may burn down. If a problem happens in one room, a house-wide emergency may erupt. A fire in the kitchen may engulf the entire house and bring it down.
In a perfect world, what happens in one house should not affect other surrounding houses. If one house burns down, the other houses around it should be fine. Same with processes. If a thread in one process crashes, it may bring down the whole process. However, since processes are separated from each other, other processes should not be affected.
Then why use threads at all? Why not use processes all the time, since they are clearly safer. Well, why don't we only have one room in our house? Threads are needed within processes to perform important roles. Also, since they all exist in the same process, they can share information (like using light switches downstairs to control lights in the foyer). So a careful combination of threads and processes are necessary to create any kind of meaningful application. There is no right or wrong answer, but Google seems to think that isolating each browsing experience from another is the right way. Firefox thinks that putting all the rooms in one house and simply growing the house is the right way. Everyone is different.
It would be an unfair test. If you opened each page in a new window with IE8, I believe that would launch separate processes for each. Since the other browsers are having each site loaded in a tab, and two of those browsers (Opera and Safari) do not create new processes for each tab, IE8 would be unfairly penalized. It would also be unfair to compare it against Chrome, since Chrome handles its own process creation and destruction from within the browser, whereas if you opened many sites in different IE8 windows, it would be Vista handling the creation and destruction of the processes.
The number of caveats and asterisks would essentially make the entire test meaningless as a measure.
No amount of good programming can help when dealing with such moronic user behavior. 900 tabs would be stupid, 9000 is a whole other plane of stupidity
To all who bash Firefox, make sure you are using newest 3.5 and not some previous version.
It seams to me that lots of people haven't even recognized a small difference in number, but it is a big milestone for Firefox internally.
Do you think it's so hard to replace "which" as well?
Or sha1sum?
That could be a little harder, but I'm sure you get my point by now.
However, there are several good reasons not to run your browser as root. First, it can do a lot more damage if it misbehaves. Second, there's greater security exposure since it means that other users who don't have sudo access on the local machine might be able to get root by exploiting the browser.
E.g. if someone exploits sendmail, but it's run as a non-privileged user, then that user might be able to find a hole exploitable only via localhost to gain root access via the browser. This is why you should run as few things as root as possible, even if they don't access remote machines.
I am sure that this is true for all of the browsers, but in Opera's case...
The machine has 4GB in question and Opera is set to "automatic" for the memory cache (default). According to this article, this instructs Opera to use up to ~10% of the system memory. This is quite tunable based on the environment, so one could easily optimize for a low-end machine and have satasfactory performance. The browser using the memory effectively is the more interesting test, which this benchmark fails to determine. An interesting detail in the graphs is how sharp the memory reclaim cycles are, where the smoother indicates better memory management. The graphs indicate that Opera does a good job in this regard.
Wow, I *wish* I could get Firefox 3.5 to use so little memory! As I write this Firefox is using 1821M VIRT, 944M RES...and I only have 23 tabs open! Firefox memory usage has always been abysmal for me. Does Firefox perform drastically differently on Linux than on Windows? I would be quite horrified if it actually performed better on Windows, but I don't understand how it possibly managed to be so low...I've never seen Firefox use less than .5G with even a few tabs open for a while... I realize my personal experience involves extensions, plugins and other things which suck of RAM, it still seems terribly high for me. If I leave it running for several days, it will peak 2G and I have to restart the browser.
It's great that in the future Firefox might be better, but here and now, the latest stable version is 3.0.11, and while Firefox has many redeeming qualities, speed, memory usage and general performance is not one of them.
Finally, this should stop perennial "firefox is a memory hog" trolls. Hopefully.
They weren't trolls. I've seen the memory leaks first hand. Plenty of people have posted OS memory usage screenshots. It may have been particular extensions or advanced settings that caused the problems but it was not some work of fiction.
You're the one trolling.
These posts express my own personal views, not those of my employer
This is a false dichotomy. Most software that uses less RAM is actually also faster.
Nowadays, it's usually faster to recompute than read it all back from RAM, and if an interactive program uses a lot of RAM, then it's likely keeping a lot of junk in memory that it doesn't need.
Wow, this is a perfect example of completely misunderstanding memory-CPU tradeoffs. No. For a non-trivial amount of data, it is never cheaper to recompute the data, at access-time. It may be faster overall, as you might be able to use the freed RAM in a better way elsewhere, but it will never speed the accessing task up.
If you recompute the data constantly, it has to hit RAM and then read it back, unless you're dealing with a dataset small enough to be stored completely in cache, in which case this is a nonissue anyway. More caching is never a bad thing, so long as you set smart defaults for how the caching is done, and you allow the users to configure it. More RAM, in the hands of a smart developer, is a Good Thing (TM).
Disconnect and self-destruct, one bullet at a time.
For idle sessions, what you want is a sensible OS, lots of swap space and apps which do not tick a lot.
While you wait for them to figure it out, enjoy the Flashblock plugin.
google "32 trillion offshore needs IRS attention"
10 is nothing. Running down the Slashdot RSS feed I may well open over 15 tabs, and from each of those I might open another tab or two (yes, I RTFAs). Chrome and IE8 handle this quite well. Opera and Konqueror are OK. Firefox bogs down for a long time, and I don't know about Safari. Hardware is Core 2 Duo, 1.83 GHz and 2GB of RAM, clean Vista x86 install.
I stopped using Firefox for reading Slashdot specifically because it was so bad at this (didn't help that its RSS interface is pretty bad, too).
There's no place I could be, since I've found Serenity...
Have you tried Ctrl+Shift+Tab? It allows you to tab backwards...
I have weird-ass artifacts on Firefox here at home, and I'm using Vista. It is very jarring to have the site look better in Opera (and MUCH better in IE) than in Firefox.
What the hell is up with Slashdot's CSS? I keep seeing images all over the comments (the bars used on the new comments section, the relationship icons). Is anyone else seeing them. I'm using Firefox 3.5.
Regards
elFarto
Have you tried Kmeleon or Kmeleon CCF ME? Both of those are OSS and from my own experience with older machines both use far less memory than FF3, due to the fact they are coded to run Win32 as opposed to XUL. The Kmeleon CCF ME build uses a little more memory, but that is due to the built in ABP support.
So if you want to get away from IE but need a browser that is light on RAM I would recommend either of the above. The CCF ME build comes in a zip so it is also quite useful as a flash based browser, if you require one. But either works really well if you are low of RAM, and they even have instructions on how to use Kmeleon on OSes as old as Win95. So give them a try, what have you got to lose?
ACs don't waste your time replying, your posts are never seen by me.
Plus, on Windows at least, the way it's made seems to let old tabs go to swap. That way it sometimes suddenly takes a lot of time to open up a tab you last used 8 hours ago, but it doesn't take as much RAM at any particular point. Can't say about Chromium on Linux, because I don't use swap there.
Be glad you are not using Konqueror 3.5.10 or 4.2.4; /. makes a point of breaking rendering on those browsers every few weeks.
Random buttons and scroll-bars? Check.
Black text on black background? Check.
Utterly broken navigation so you can watch the front page and nothing else? Check.
CSS, Javascript and other crap in _plain text mode_? Check.
The only reason I keep coming back here for is the friendly discussion style ;)
I think the Chrome processes share a lot of their virtual space, so their actual memory usage is a lower.
Those who would give up liberty to obtain working drivers, deserve neither liberty nor working drivers.
Why? I run a very small custom linux off a read-only flash on a very-very old panasonic notebook whose HDD burned accidentally.
I like it because it is still smaller than a netbook, has a touch screen, and the battery lasts 7 hours.
I couldn't care less if someone compromises my current session (even if they could), as I'll be starting afresh from the flash rom next time anyway.
Besides, I could very well be running root with UID 1000 instead of 0, how would you know?
Anyway, back on topic, the new firefox isn't the memory hog it used to be, at least on my system.
I use QuickRestart plugin, so when Firefox is having her period, I just restart it quickly. All the web pages that were open will reload again.
Usually I use it for Java unresponsive errors, since I have 4 ton of ram.
Love many, trust a few, do harm to none.
I see weird-ass icons and bars on Slashdot comments in Firefox, on Mac OS X 10.5.7 and Windows XP SP2. I don't get those artifacts in any other well constructed site; only on Slashdot.
What's more, they occurred right after they fixed the white-on-white-comment-title CSS bug. Although it could certainly be a Firefox rendering issue, it seems to me more of a broken CSS issue from Slashdot web developers.
Just as that other annoying bug, I can work around it by clicking the "CHANGE" button without making any threading changes. Which offers another suspicious clue: why is the page rendered differently at that point?
-dZ.
Carol vs. Ghost
That's simply not true on modern computers. The CPU is often idle - it's starved for data, with the bottleneck being the buss that feeds it (RAM, generally). Add to this the fact that reading neighboring areas of DRAM is a much faster than randomly reading spots in in memory spread across whole megabytes (or gigabytes, even).
For the discussion at hand, this is irrelevant. Browsers aren't recomputing trivial data with their time. Browsers are rendering images and text to image buffers and then displaying them on screen. Rendering graphics via software is always slow, and with things like alpha compositing in modern browsers like Firefox, it's getting even slower.
Real software developers have taken this into account; we cache glyphs, we cache images, we cache rendered sections, we cache anything we can cache. Which is why viewing a webpage you've viewed before in Firefox is usually a task that resolves faster than you can see, but eats up a bit more RAM.
Lastly, you're throwing away one other concern, which is supremely important to people today. Whenever the processor is idle, it's using very, very little power. The longer the processor stays in that state, the less power is used and the less power is dissipated. Less power, more battery life, cooler server rooms, etc.
It's a tradeoff. It will always be a tradeoff. Sometimes it's cheaper to recompute, especially if RAM is the bottleneck, which it isn't anymore; if you're simply unicode lookups or hacking buffers together, fine, throw the RAM away when you're done. Other times, like rendering pages of high quality anti-aliased text, you don't want to be doing that every time through if you can help it, so you render to an A8 buffer and throw it in a LRU.
As I write this Firefox mem usage is 271,480 MB and had peaked at 323,864. I have 4 windows open. One has 5 tabs, the other have 1 tab each. I just closed all except the 5 tab window and I'm only back down to 260,892.
That's not as extreme as it once was, but it's not gone. I get a truckload of memory back by killing the browser and starting afresh. Some of that is necessary due to session history etc. but the fact remains FF is a memory hog.
If you're not seeing similar memory usage your browsing habits are probably different. Possibilities include:
- Different extensions
- Visiting different web sites with different types of content (eg. flash)
- Using tabs and new windows differently
That doesn't make what I'm doing abnormal, unusual or wrong. FF gripes are legitimate.
These posts express my own personal views, not those of my employer
You're comparing to an OS that was released in 2001 (xp) and which isn't really sold anymore, nor does it come with new PC's. In Vista and Win7 users dont run by default as administrator and install even says that its encouraged to create separate account for user. UAC (win7 has better uac than vista) also protects doing stuff under admin. Its just as usable as sudo *if you know what you're doing*. Different tool doesn't change users stupidness or ignorance.
Except, under Linux, it isn't really that much easier to run as root. Actually - running as root is a hassle because many apps complain if you do so.
Dear god man, just hit bookmark all tabs, create a bookmark for each of them (in a couple clicks total) and give up. Then you'll still have a record for them if you want them, you'll be able to search them in fact, and then you'll be able to go back to starting with a few tabs or what you actually read.
Wow stop feeding this troll. LOOK AT HIS NAME. How can you not see this? I can't believe he got modded up, probably because there's some windows fanboys around, or just those idiots who believe every troll that jumps out and says "in MY experience!"
Firefox runs all its tabs in one process, whereas IE8 creates a new process for each one. So if you have one tab open in FF and one in IE, then IE might be smaller (FF is about 130mb and IE about 60). But each new "tab" (not really, it's a new process so may as well be a new window or instance of the program) in IE is another 30-60MB, but each new tab in FF adds a negligible amount of memory usage.
Open five tabs in each, tally up the usage from all the IE processes, and then compare.
(\(\
(^.^) INFECTED
(")")
http://kb.mozillazine.org/Browser.cache.memory.capacity
"When images are loaded, they can be cached so they don't need to be decoded or uncompressed to be redisplayed. This preference controls the maximum amount of memory to use for caching decoded images and chrome (application user interface elements)."
It defaults to 32 MB on an 8 GB system. Opera will use 0.8 GB in that scenario... And will cache tab history, HTML, CSS and JS as well, not just images. Again, not comparable. Firefox just doesn't do what Opera does, even if you give it the same amount of RAM for the cache.