Why Does Firefox Use So Much Ram
Posted : admin On 12.09.2019There are two issues here. One is that the web can use quite a lot of memory. High resolution images and video take up a bunch of memory. The other is memory leaks.Background: there are two common models for memory usage in programming languages. One is manually managed memory. That's where, every time you want memory, you ask the OS for it, then, when you're done with it, you explicitly tell the OS you're done.
The other is garbage collection. You still ask the OS for memory when you need it, but instead of explicitly saying you're done with it, you just stop using it, and there's an automated routine (called a garbage collector) that runs every once in a while and looks at memory. When it finds something that's not being used any more, it tells the OS you're done with that piece.Both have their upsides and downsides.
But when it comes to memory management, the reason for this increased usage isn't as simple as it seems. If you've ever wondered why browsers like Firefox use so much of your precious RAM, read on. This is probably common sense, but the more tabs you have open, the more RAM your browser will use.
Manual memory management is better in the best case, but worse in the worst case. It's more efficient and more predictable if you do everything right, but if you forget to tell the OS you're done with some memory, then it never gets released, and you'll just slowly accumulate memory that you don't need anymore. This is called leaking memory. Garbage collection is easier to write and has a better worst case (you're not going to leak memory), but it's less efficient and less predictable. It's less efficient because there's no such thing as a perfect garbage collector, so you're going to have some memory you keep that you are actually done with. It's less predictable because you never know when the garbage collector is going to run. And if it decides to run and take a while you're, say, animating something, the system might stutter because the animation code doesn't get to run.
This makes writing anything that might display or render video in a garbage-collected language more challenging. You better make sure the garbage collector doesn't run for very long in the 1/60th of a second you have before you have to display the next frame. Meh, I just don't care about the memory usage anymore: I've got 16GB of cheap RAM.I'm more concerned with it stiffening up after a few hours, needing the dreaded 'restart to clear everything'; and much much more with Mozilla's demented copying of whatever the unspeakable Chrome or Opera does next. I would say it was at it's peak around Fx 4, and since then has been declining into a minimalistic mess. And their useless refrain of ' disable all extensions, then reenable one by one', then ' create a new profile', as a cure-all has got massively tiresome over the years.However, I shall never use a different browser.
Even if it sucks, the others suck more. Meh, I just don't care about the memory usage anymore: I've got 16GB of cheap RAM.I'm more concerned with it stiffening up after a few hours, needing the dreaded 'restart to clear everything'; and much much more with Mozilla's demented copying of whatever the unspeakable Chrome or Opera does next. I would say it was at it's peak around Fx 4, and since then has been declining into a minimalistic mess. And their useless refrain of ' disable all extensions, then reenable one by one', then ' create a new profile', as a cure-all has got massively tiresome over the years.However, I shall never use a different browser. Even if it sucks, the others suck more.
Fx Forever!Actually - and I realize I'm losing serious geek cred here - I've recently abandoned Firefox as just being too slow, and am trying out IE again. I'm using the IE 11 Preview now, and I've got to say, it's faster and uses half the memory of Firefox. It's not quite as customisable as Firefox; I can't change the tab behaviour, but I can live with that.There's an addon for adblocking, called, and that's about the only one I want or need. Note that there's a free and a paid version - the freeware doesn't block as many ads per day as the paid.Chrome?
Fine for those as like it, but there's something about it I just don't like. Meh, I just don't care about the memory usage anymore: I've got 16GB of cheap RAM.Given RAM prices I don't understand why more people don't go this way. I usually have 150-200 tabs open (various projects plus personal tabs), plus an entire virtual machine (with it's own browser open), several MS Office aps and it doesn't break a sweat. Oh, and right now I have Bioshock Infinite running on Very High on my second monitor and my machine isn't running any differently.I don't have a super-duper machine (though it was fairly powerful when I first built it), I just have buttloads of relatively inexpensive RAM.Of course, it's only so long before developers realize this and stop trying to plug memory leaks or being careful for it, so back to ground zero. Iamthewalrus(:3= provides a nice quick overview of the main issue. Languages with automatic storage management have come a long way, and in garbage collection a very long way.
Parallel and incremental garbage collection algorithms have been around for a couple of decades, and there are even GC systems directed at soft real time applications.The core of Firefox is coded in C and that alone (IMHO) is enough to doom it. But an enormous amount of Firefox is coded in Javascript - which is a language with automatic storage management (and a language that should have been strangled at birth.) I suspect the problem is much worse than simplistic memory leaks. It doesn't matter if your system has perfect garbage collection, for as long as the running program maintains a single reference to the allocated memory, it won't be reclaimed. Firefox is a very big messy beast, and with the proliferation of addons and constantly moving target of features, it just keeps adding more and more stuff, with not a lot of overarching control. Looking at Firefox on my Mac right now it is running 38 threads with only about a dozen active tabs, and chewing about a gigabyte of memory. No amount of simplistic garbage collection is going to harvest any un-needed threads, and whilst they are alive they will be holding down memory.
Many of those threads are probably are result of various add-ons in use. Personally I won't use a browser without No-script and Ad-Block makes things much nicer, if you use Facebook you want FB-purity, and so it goes. It is very likely that many memory leaks are the result of interactions between add-ons. The lack of any overarching control makes this very hard to manage.
It's memory leaks and the latest release looks particularly egregious.Switch to PaleMoon - it's exactly like FireFox except way faster and less buggy, and it uses the same addons. FireFox just tries to remain too compatible with ancient hardware for it's own good.After seeing this post I actually went and downloaded Pale Moon, and copied my Firefox profile, including all extensions, over. I've got them both running simultaneously now, with the same theme and extensions enabled, and according to Task Manager, Pale Moon is using quite a lot more memory than Firefox.Right now I have this dope page open in Pale Moon and its using 214,468K.
The Yahoo home page, which is surely more complex and graphics heavy, is open in Firefox (both browsers have Flashblock running) and it is using 106,996K: well under half the memory.I am not seeing noticeable performance enhancements either. The explanation is the memory leaks, as has been repeated in this thread several times.There's plenty of things developers can do that will suck memory fast if they're lazy. Not fixing memory leaks or allocating too much memory are the two biggest.You are not kidding! But it's not all laziness.
Too many people working as programmers today have not had formal training, and don't know why they would need it.I would be very happy if programmers had taken little more than a 'combinatorial algorithms' (math or C.S) class and the C.S. Prerequisites leading up to it. As to the effect of programmers not knowing the difference between order n and order n.2 (o more) algorithms, I first ran Mozilla on a 4 MB Vax 11/780 which was a one MIP (roughly equivalent to one megahertz) machine, and it ran just barely slower back then than it does now on Intel processors that execute code at least 4000 times faster.A bit of the difference is due to memory allocation issues, but the majority is due to code being written by multiple people who don't understand what has already been coded and reinvent the wheel over and over. It's memory leaks and the latest release looks particularly egregious.Switch to PaleMoon - it's exactly like FireFox except way faster and less buggy, and it uses the same addons. FireFox just tries to remain too compatible with ancient hardware for it's own good.PaleMoon looks interesting, but from reading the general description on the site, it appears to mostly be optimizations to make it run faster rather than improve the memory footprint - the site states that memory use is 'slightly' less than regular Firefox.But I agree, Firefox memory use is totally ridiculous, and the only thing I can say in its favor is that Chrome is no better.
For instance right now I have nothing open except this site, and Firefox has eaten 232,824K of memory and climbing! I could switch to a simple Google search page and it wouldn't change much. Kids these days just don't know how to write efficient software! Who said anything about 'need'? It's dirt cheap to run an enormously powerful machine (with respect to keeping tabs open), so it's a convenience. I have books and projects that span months to a year or so and there are handfuls of tabs that are easier to keep open than bookmark/whatever to go back to if I need them (colorful tabs add-on makes this even easier).Looking back, I find a bunch of tabs open for a project that closed months ago. No problem; half a second of closing and it's over with.
Need to find tabs? They're opened chronologically so it's no problem skimming through them. They're easily movable, so if I want to keep something current I can. There are a tab-load of reasons to keep things around, and again, since there's essentially zero performance hit and there's minimal effort to find what I'm looking for, there are several upsides and no downsides.But, of course, YMMV-particularly if you have an underpowered machine and the $50-$100 to bring it up to par is beyond the budget.
Why Does Firefox Use So Much Ram 2
I think system power is irrelevant - what on earth is the advantage of keeping vast numbers of tabs open and active instead of simply using a nicely sorted bookmark list? It's like keeping every jar in your kitchen on the countertops, because two weeks from now you might need a pinch of powdered ginger. Or spreading all your tools on the garage floor so that next week the 10mm box wrench is right at hand.Different strokes, sure. But I can't imagine any advantage to using vast numbers of open tabs as a 'live bookmark' system.For reference, I currently have a three-monitor system and it is a rare minute that FF is not open in the left-most, vertical-page one. I am a heavy, heavy browser user for a dozen primary purposes - reference, research, amusement and more. I have probably 3-4,000 bookmarks, 75% of which are current in some sense. So I'm not questioning the practice from the perspective of someone who does nothing but SM and wiki-walking.
But I don' geddit. It's memory leaks and the latest release looks particularly egregious.Switch to PaleMoon - it's exactly like FireFox except way faster and less buggy, and it uses the same addons. FireFox just tries to remain too compatible with ancient hardware for it's own good.I have to admit my HW is fairly ancient, but an even bigger concern is whether I'll be able to import my userids and passwords. That's the main reason I haven't already given up Firefox. And it's a tragic thing-Firefox was the browser we all went to, years ago, as a faster and leaner alternative to Internet Explorer. Who said anything about 'need'? Nothing out of the ordinary.

Colourful tabs is great, but that's just a small visual cue and helps keep things separate. TabMixPlus or something lets me set the minimum width of tabs, so maybe that helps-there's always a favicon and three letters which tells me enough to recognize the site the tab is on. So right now I can see about thirty-five tabs across the top of the screen.These are all entertainment or fluff tabs, the most recent from a few minutes of checking in on the web. There's a dinner reservation (Open Table) from last night I know I can close. I'd left it open after making it so I'd have the address/phone number if we needed it. Bookmarking and then closing it would take more time than simply closing it, and reloading the page wouldn't necessarily bring it back the same information (I'd have to log in again, too).There are also several news, Dope and Reddit tabs, along with a few YouTube and other sites (probably opened in relation to a thread from the former two). There is some ambiguity about what the actual thread is, but searching tabs is trivial if I'm looking for something specific.A double-click on the tab overflow arrow moves by ten to fifteen tabs at a clip, so scrolling back to the beginning of even a monster number is an eye blink, so there's no loss or effort there.
Download wondershare pdfelement 6.2.2.2615. And this is kind of key-tabs are already loaded in the browser, so clicking a tab to see what's in it if it's vague is an instant process. No need to wait for their servers to respond, for the content to download, etc.
Firefox Uses Too Much Memory
So a client calls and I need something that may be scattered across a handful of sites, it's easy to go back that far and find the set. And again, because they're pre-loaded, I don't have to wait at all sifting through the list.When I have the time/inclination, I'll go back and cull the list, close-close-close-keep-close-close-ooh,thislooksinterestingletmereaditnow-close-close-keep-keep.Bookmarking/deleting the bookmark is, to me, more work than just leaving the tab open. I'd still have to open and close the tab anyway, so there's no time savings there. I'd also have to create and then delete the bookmark, extra work I don't have to do. The convenience of tabbed browsing that makes it nice to have ten tabs scales up very nicely.