Notes On Reducing Firefox's Memory Consumption 297
Skuto writes "At yesterdays linux.conf.au Browser miniconference in Ballarat, Australia, Mozilla engineer Nicholas Nethercote gave a detailed presentation about the history of Firefox's memory consumption. The 37 slides-with-notes explain in gritty detail what caused Firefox 4's memory usage to be higher than expected, how many leaks and accidental memory use bugs were tracked down with Valgrind plugins, as well as the pitfalls of common memory allocation strategies. Current work is now focused on reducing the memory usage of popular add-ons such as AdBlock, GreaseMonkey and Firebug. Required reading for people working on large software projects, or those who missed that Firefox is now one of the most memory-efficient browsers in heavy usage."
Firefox is required anyway. (Score:5, Interesting)
I use other browsers for development, but only Firefox to browse, it's the only browser that I feel is actively protecting my privacy.
Any other opinions on that?
Re:Firefox is required anyway. (Score:5, Insightful)
I use firefox because my plugins make the web a much nicer place to be.
Re:Firefox is required anyway. (Score:5, Insightful)
Agreed. IE is shit, and I don't trust Chrome.
I know it might be judged as paranoid and irrational (and to a degree, it is), but I really want the bare minimum of Google products on my computer. I just don't trust them. I've seen too many previously "good" companies abuse their power once their product is entrenched on everyone's computer, and I don't want to give Google much of a chance in that respect.
Firefox isn't only the best for my needs, it's also the least of all evils that has the features I want.
Re:Firefox is required anyway. (Score:4, Informative)
Agreed - and the power consumption is much lower than Chrome's (the only viable alternative, IMO) too.
But how do I speed it up? Chrome is MUCH faster on my machine, and I'm using a Firefox profile that's barely a year old, without many add-ons installed (NoScript and ABP go without saying... ImageZoom, NoSquint... that's pretty much it). And Firefox keeps thrashing my disk (No, I'm not swapping it out for an SSD - I only have one hard drive slot in my laptop, and it's filled with a big-ass mechanical hard drive)...
Re: (Score:2)
If your firefox is a year old, you've missed like 3 major revamps of the javascript engine. The performance difference between then and now is enormous.
Re: (Score:2)
Actually I meant that I've been using the same profile for all this time - that hasn't atopped me from upgrading to the latest FF ver
Re: (Score:2)
Forgive my ignorance, but what would using the same profile have to do with anything? It doesn't accumulate cruft like the Windows Registry or something, does it?
Re: (Score:2)
Accumulating cruft is EXACTLY what a Firefox profile does. To begin with, they're tiny... mine has grown to over 1GB in size, and Firefox thrashes the hard drive every time it's opened or closed. :(
Re: (Score:2)
You must have a lot of bookmarks :D
Seriously, I never had such a problem. Do you have any idea what can take up so much space?
Re: (Score:2)
Looks like cache, mainly. Just deleted that and it's back down to about 200MB - that's still huge though, isn't it?
Don't really have that many bookmarks, and my history shouldn't be all too big...
Re: (Score:2)
Which files in your profile folder are the largest?
Re: (Score:2)
Bulk deletion via filters sounds good... thanks for the tip!
Re: (Score:2)
I've seen suggestions that it does, particularly after upgrades, though I've not looked into the issue myself so I'm handing over unverified anecdotal evidence here.
Even if cruft doesn't build up in the profile itself, the filesystem objects used to store it may become fragmented and spread all over your driver over time as the cache is constantly updated and the database files it keeps (for abusive locations lookups and so on) g
More configurable, better plugins. (Score:5, Insightful)
I use FF because it is much more configurable (about:config has entries for more than any other browser), it also has more plug ins, and those plug ins it does have tend to be more effective for just about everything.
I also don't like Google Chrome calling home all the time (uninstalled). I also have IE9 and Opera installed.
Speed issues are moot outside of benchmarks these days (unless you are running IE7 on a netbook). IMO it is pure placebo effect to say one browser is faster than another in regular browsing on a modern computer.
SRWare Iron (Score:2)
http://en.wikipedia.org/wiki/SRWare_Iron [wikipedia.org]
--Coder
Re: (Score:2)
For regular browsing I believe you're right. However, there are a couple of Google spreadsheets I use (I didn't create them) that are painfully slow under Firefox but just awfully slow under Chrome. So speed does matter for more than just benchmarks, but not necessarily for regular browsing. Note that this is on a self-built desktop gaming system that's less than a year old, so it's not like I'm comparing this on my dual-core netbook.
Link?
Also is it open? I wonder if the result would be the same if it were loaded in Zoho sheet:
https://sheet.zoho.com/login.do?serviceurl=%2Fhome.do [zoho.com]
It seems that Google probably made more optimization efforts for Chrome than Firefox.
Re: (Score:2)
Any other opinions on that?
Maybe this one. [comodo.com]
Cool.
Only runs on Windows though, that leaves me out.
Re: (Score:2)
http://www.srware.net/en/software_srware_iron.php [srware.net]
It's basically Chrome with all the tracking stuff stripped out. And they have a Linux version. Last I tried it it was a few versions behind Chrome, though that shouldn't be that big of a deal.
Re: (Score:2)
I see that they have an Ad Blocker. That's nice, and one reason to use firefox. But ads aren't the real problem, they are just annoying (OK, A real problem, but not THE real problem).
XSS, cookies and local storage is where the most privacy concerns crop up. Mostly XSS. I saw no mention of that on the chrome vs iron page.
http://www.srware.net/en/software_srware_iron_chrome_vs_iron.php [srware.net]
Re:Firefox is required anyway. (Score:5, Insightful)
Give us more options (Score:5, Insightful)
I have 8gb of memory on my main computer. I want firefox to use up as much of it as it can to improve my browsing experience. On my netbook, I have 1, I want it to sip as little as it can. There should be an easy way to tell the browser how much memory I want used for certain tasks such as caching and whatnot. Addons should have their own seperate allocation, and each individual addon should be configurable for how much memory it can use.
Free / Open source software is about choices to run things how you want to. With that said, I don't have much room to complain because I've never contributed code to FF.
My main point though, is that screaming "THE RAM USAGE IS TOO HIGH" is not effective. I have a lot of ram, and I want it to be used, just not wasted; and I want more control over it.
Re:Give us more options (Score:5, Interesting)
250ish MB or RAM is hardly unreasonable and is significantly better than the alternatives. If you don't like the RAM use with Firefox then you sure as hell aren't going to be happy with the competition. I haven't seen a benchmark or other comparison in a long time where Firefox didn't trounce the competition by a significant margin.
TFA does raise an important point that the memory consumption problems are mostly with certain add ons. The vanilla install itself doesn't have those issues.
Re: (Score:2)
I remember when a 360 kB floppy disk was considered a lot of space. A 10 MB IBM hard disk was physically big in those days, as large as the main case of the IBM PC it connected to.
In other news, hard disks are again bigger then computers nowadays - the Raspberry :-)
Re:Give us more options (Score:4, Informative)
Listen up, young'un - I remember when we bought a 10MB hard disk for our lab's HP1000 mini-computer back in the early 1980s. That thing was the size of a dishwasher.
Re: (Score:2)
Re: (Score:2)
Yes and I remember starting out on computers where I would have killed to have even the 1.44MB capacity of a High Density 3.5" floppy. Of course that was over 25 years ago and I'm not sure what relevance this has when you have to look hard to buy a computer with less than a gig of RAM. Handhelds and phones not withstanding.
Re: (Score:2)
Re: (Score:2)
Interestingly enough, I still know of at least one datacenter around here that still uses those oldschool tape machines with the huge reels that you sometimes see in old movies.
But, really none of this is particularly relevant to the notion that a browser uses over 200MB of RAM.
Re: (Score:2)
Yes, and I bet if I went back to using Lynx I could probably get RAM consumption under 1MB. The point is that of the browsers that people are likely to use, Fx tends to do a lot better than the competition.
It's trivial to create a low RAM browser if you don't implement anything beyond that absolute bare minimum.
Re: (Score:2)
I'm currently using Opera - Two windows and over 20 tabs open with different fully-loaded "big name" websites in all tabs. Some logged in, some not. Instant access to all my emails dating back to pre-2000 (with instant-narrow searching) covering some 5-6 Gb of email files on my profile (several POP and IMAP accounts all downloaded entirely to the Opera mail client) - which Opera stores as SQLite files, IIRC.
The same Opera session has been running for about 2 weeks straight, just suspend/resume as I take t
Re: (Score:2)
It's
Re:Give us more options (Score:5, Insightful)
I have a lot of RAM, too. And Firefox runs like shit. It has for years and I've constantly heard the response of "no, you don't understand! it's just how it handles its back button function! That's why it uses two or three gigabytes!". I have 16gb on my primary system, so it can certainly use a few gigs if it really wants to. The question is - does it need to? More importantly, how does it perform when it's using so much RAM? That is the real problem.
For years, I have put up with the experience of Firefox slowly grinding to a crawl. Within hours (certainly within a day at the most), it reaches 2.5gb or more memory usage and becomes unusable. Almost every action - typing, scrolling, clicking a button, entering a URL, clicking a link - causes it to hang temporarily. Sometimes for almost a minute. Click a tab. Hang. Scroll to the bottom of the page. Hang. Type in the text box. Hang. Submit. Hang. Close tab. Hang. Terrible experience.
And, I stuck with it. Restarting the browser every few hours just became part of the experience (starting around early 3x, I believe). I primarily stuck with it, because I love Firefox and have used it forever. And Mozilla before that. And Netscape before that. Part of that is that I cut my teeth as an engineer at Netscape when I was young. It was my first real job. So I had a particular affinity for it, always. Besides, eventually they'd fix the issues. Even though they went forever claiming there weren't any memory issues . . . until sometime recently (last year, I think?) when there finally seemed to be acknowledgement of it.
Most of all, I like having the access to extensions. Primarily, adblocking extensions. And then the tree tabs extension. And then panorama/tab candy was built into 4x. I tried Chrome several times, but their shitty handling of many tabs was terrible. I couldn't tolerate it. Firefox did it beautifully.
And then, I finally got fed up. After all those years and all the delaying and all the excuses I made for Firefox, I decided a couple months ago that I would go full time Chrome and just see what it was really like. The result? I'm sold on Chrome, now. I can't believe I'm saying this, but I am. I never have to restart due to it behaving slow. I never have to restart due to it using too many resources. I never have it beach-balling for a minute at a time for every action I do. I never have Windows telling me the application has stopped responding. It just works.
And here's the thing. It uses just as many resources, sometimes. Just like Firefox, I sometimes find it using as much as 3gb of memory. But where Firefox would start grinding to a halt around 1.5-2.5gb of usage, Chrome just keeps smoothly chugging along under as much as 3gb (and possibly more, but it never has used more than that, so I don't know).
So, we can make all the excuses we want for Firefox. When it comes down to it, what matters is that my browsing habits cause Firefox to perform fucking terribly, while Chrome doesn't flinch. And when it comes down to my time and sanity, I need performance; not excuses.
Re: (Score:2)
Re: (Score:3)
Re:Give us more options (Score:5, Informative)
I want firefox to use up as much of it as it can to improve my browsing experience
RTFA. When FireFox has an off-by-one error in its JavaScript string concatenation code that causes it to allocate twice as much memory as it needs for JavaScript strings, it's not using memory to improve your browsing experience, it's just using memory. When FireFox is storing decompressed images in memory that never actually make it to the screen, it's not using memory to improve your browsing experience, it's just using memory.
Most of the techniques in TFA were of general interest to anyone working on a large project, not just to FireFox.
Re: (Score:2)
I wish each tab had a flag "this tab is important -- don't release memory allocated with this tab if not visited for a while." Most of my browser memory is wasted on tabs that I didn't bother to close even though I'm not coming back to them.
A couple of problems (Score:3)
At work I have a quad core Q6700 [intel.com] with 4GB of RAM. At home I use an older single core Athlon 64 3500+ [amd.com] with 2GB of RAM. Both machines run Windows XP.
Both machines run FF 3.6 because I keep reading that later versions have worse memory use and UI performance characteristics.
On both machines, I experience two problems with FF memory usage (all figures were reported as "private bytes" by Sysinternals process explorer):
1) Memory usage keeps growing until it reaches a threshold (1.5GB on my home machine) after w
Re:A couple of problems (Score:4, Insightful)
Both machines run FF 3.6 because I keep reading that later versions have worse memory use and UI performance characteristics.
... people say that 3.6 is more responsive (especially on older HW) than the newer versions.
Those people are wrong. Newer versions of Firefox are *much* faster and use less memory. In fact, lowering memory usage became a priority right about the time you stopped upgrading. Ironic, eh?
Re: (Score:2)
Re: (Score:2)
You can adjust the disk and memory caches on firefox still.
The problem
option to browse without images (Score:2)
Since so many in this thread talked about ancient history, I'll mention one. Does anyone remember the option to browse without images, from back in the day? Sometime around Netscape Navigator 2? Used to be a rather prominent option, but somewhere along the line it was quietly dropped off the menus.
Re: (Score:2)
There's the IMGlikeOpera addon that does that feature while still allowing to load per-site or individual images. It's my main reason to stick to Firefox, since Chrome addons can't prevent content from loading.
Unfortunately that addon is one of the first addons to break if something changes, and it's not developed actively at all. On its favor, it didn't break in about 4 releases, but can happen anytime.
Re: (Score:3)
I think the big deal here is that memory was wasted, and the guy has done his profiling and tooling and has reduce the wastage dramatically.
Good job that man.
However, in general, apps that use lots of ram are bad for you - you may have 8Gb, but if it uses all that, your whole system is going to be slower simply because all the data is being sloshed around inside your PC. The days where more ram = fast PC is gone, today your CPU cache is the new bottleneck that turns your screaming-fast 3ghz processor into a
Re: (Score:3)
I have 16 GB on my main system, and I don't want Firefox sucking up all my RAM. Firefox devs seem to miss a few key points about what I think is a very common usage model: A - Browsing is not my primary Application. (For me, it's graphics software. Other people may have MS Office or an IDE.) B - Browsing is the one app where I never want to lose state. (I'm willing to close my
Re: (Score:3, Insightful)
No, it shouldn't use any more memory than it needs.
How much memory does it need? I'd much rather that it cached recent pages in RAM than on disk or not at all.
250MB is nothing on a modern PC with many gigabytes of RAM. My laptop has 6GB, and logged into Gnome with Firefox and another app running the OS is using a whole 900MB, only about half of which is being used by applications. Why not do something useful with the rest of the RAM?
Re: (Score:3)
Need. What does anyone need? here's the issue. no one cares a hoot how much memory a program needs until you need it for something else. Yes, minimum memory usage is bad when it means your program isn't doing as much as you'd want or like it to do. But, when you set the browser to use a ton of memory, and then need it for something else, how does the computer respond? Few programs can suddenly release a chunk of memory for you because some other program has requested more than is available. If it can, t
Firefox's problem (Score:5, Insightful)
BUT, when a plugin/page starts leaking lots of memory the difference is with Google Chrome you can close the offending tab/window and the memory is freed up. You don't lose your sessions, don't lose your place on other tabs/windows. You can even reopen the page (esp if the page just slowly uses more and more memory).
In contrast with Firefox you often have to close the entire browser to free up the memory. And IMO that's Firefox's biggest problem when it comes to memory.
It doesn't matter how much better Firefox is on its own at memory management, in practice many people using Firefox are using it because of the plugins (otherwise they'd be using some other browser), and the plugin developers may not be so good at memory management.
Re:Firefox's problem (Score:4, Informative)
It depends which ones you're talking about. Some of them are already in their own separate process and you can kill those processes without having too much trouble. The bigger problem right now is all the freezing that goes on. I'm not sure what the problem is, but it gets a lot worse when I also have thunderbird open.
Re: (Score:2)
I probably should have been more clear about that being plug ins rather than extensions.
Re: (Score:2)
Re: (Score:2)
I do not know a way to identify which plugin corresponds to which tab. Usually, if you have a video running, it's instance of a plugincontainer take the most CPU, but as for the rest - no idea who is what. Also sometimes there are 20 or so of them (don't die gracefully) and need to be killed one by one tediously.
Re: (Score:2)
Remove/disable the extensions and Firefox leaks less, but then you might as well use Chrome
Re:Firefox's problem (Score:5, Informative)
It doesn't matter how much better Firefox is on its own at memory management, in practice many people using Firefox are using it because of the plugins (otherwise they'd be using some other browser), and the plugin developers may not be so good at memory management.
Actually, the presentation addressed that. They're going to add a notice to known bad add-ons at the Mozilla add-on page (social engineering), and also add a basic leak test to things done by the reviewers.
Re: (Score:2)
>In my experience Firefox (minus plugins etc) has leaked/used less memory than Google Chrome.
I corroborate with that. Recently I got tied of Firefox and decided to try Chrome. I have got less memory usage per instance but instances open, so in sum, Chrome ends up with more memory usage. First thought that comes to mind is that with new tab - new thread/processor iedology one might bring unnecessary overhead into play. I suspect that Firefox does it only for pages which require plugins (runs its plugin-co
Re: (Score:2)
Although these leaks are not Mozilla’s fault, they are Mozilla’s problem. Many Firefox users have add-ons installed -- some people have 20 or 30 or more -- and Firefox gets blamed for the sins of its add-ons.
Now they are going to improve reviews and make it possible to mark add-ons as memory-hogs / -leakers.
i'll do my own tests (Score:2)
Re:i'll do my own tests (Score:5, Insightful)
Yeah, most of the improvements were in the last 4-6 months.
Anyone else get tired of this... "blah blah, my favourite open source browser wasn't competitive with the commercial product by an ad agency that records every keystroke I type in the URL bar a long time ago, possibly due to some addons I was running, so I just completely gave up on it and whenever a story comes up on how it has improved, I just state how it sucked at some time in the past and I'll never try it again"?
Re: (Score:2)
I wish I could mod this up +1000
Re: (Score:2)
Maybe you should learn to report bugs. Because hundreds of thousands of people are running the browser with no issues.
Re: (Score:2)
Again, as from your perspective, that motivates me to perform my own checks. However, if they don't provide a ready-built linux/ppc64
Re: (Score:2)
I've been running recent firefoxen on 64 bit Ubuntu with over 340 open tabs. It used over 1.5Gb RAM, but that seemed reasonable in the circumstances. Chromium failed entirely with a fraction of the tabs.
On the other hand, I did find a firefox extension a couple of months ago which managed to leak over 1Gb/day (I'm afraid I can't which it was).
Re:i'll do my own tests (Score:5, Funny)
with over 340 open tabs
I think it's time for PybusJ to admit he has a pr0n problem...
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Pale Moon browser (Score:5, Interesting)
Windows users should investigate the Pale Moon browser over at www.palemoon.org. Firefox optimized and without all the gunk.
In my experience... (Score:3, Funny)
Firefox is the app that uses the most RAM in my system, has always been, even more that Skyrim under WINE. I tried Chrome for a while, and while I didn't dislike it, I simply didn't want to forfeit my customized environment.
However, I never saw Chrome as using any less RAM. I usually got Firefox with 20+ tabs open (and around 100 in "not loaded in RAM" mode with the new features, think old BarTab) grouped in Panorama groups. In Chrome, because tab space is small, I usually had around 20, and both browsers were consuming 400mb of RAM each. I'd say Firefox uses LESS memory overall.
Thing is, firefox FEELS slow. Try to open Youtube's subscriptions page and you'll lose control of the browser for at least one second.
I can easily see people unable to close their porn when their significant other enters the room. Porn moves the world, thus people would prefer to use Chrome for porn. Thus Chrome's usage rises while Firefox's decreases. If Mozilla makes it more convenient to use Firefox for porn, the browser usage will crush Chrome.
Re: (Score:2)
Same for me but that's expected. What have I open on my Ubuntu desktop now? FF, Skype, Thunderbird, terminal, emacs. FF looks like the most complex application among them and the one with more data inside (many open tabs). I run top, sort by virtual image size and I see dropbox coming first (WTF?) in front of FF. Then nautilus and thunderbird as distant 3rd and 4th. Then clock-applet (wow). Dropbox and clock-applet are two really surprising memory hogs. I still remember when the process that filled my memor
It isn't a memory leak... (Score:3)
... its just accidental memory usage.
Oh good, I was starting to get worried there.
Re: (Score:2)
Can't tell if you're being snarky. A memory leak is a very specific thing (pointer lost before free'd). If this happens in a loop or some other repeated code, memory usage grows out of hand with no recourse. Accidental memory usage is a much less concerning problem, because it's relatively straightforward to deal with during execution. It's also less likely to grow unbounded.
Hmm (Score:2)
I get warnings from AVG about every other day warning about FF memory usage looking suspicious. I'm pretty sure I'm not infected with anything. But having say 3-4 tabs open on Win 7 (might be the problem ;-)) uses ~560MB of RAM. Not overly complex sites either, /., coding site, youtube say (not playing a video). That said I rarely hit 80% of RAM used overall so I don't really care how FF uses my RAM other than if more RAM implies slower because more stuff has to go back and forth to the CPU. It could just m
Re: (Score:2)
Oh and large probably due to memory leaks this happens after using FF for two days without closing it.
Memory leaks are easy (Score:3, Interesting)
Re:Memory leaks are easy (Score:5, Interesting)
You should read the article, which actually touches on this. One issue is that a "memory leak" can include memory that does in fact get released at shutdown, especially in garbage-collected systems (not a problem in C, of course).
So you can have situations where you close a tab but its memory is kept alive for a while because an extension is referencing it. Not a leak in the C sense, but a leak in the sense the user cares about.
Re: (Score:3)
The problem is not finding where in the source malloc was called. That is easy. The problem is finding where free wasn't. That is harder.
Memory usage (Score:2)
I don't remember right now the setting, but what finally 'fixed' FF's big memory usage for me was reducing the number of pages from the history that it keeps in memory, in case you hit the 'back' button.
There's a setting that controls this. I think it's browser.sessionhistory.max_entries Search for that.
If you browse image-intensive sites, I saw memory usage get up to 4-6GB before. Now, it never goes over 1GB, with 50 misc tabs open still.
Re: (Score:3)
Re:misslabeled linke (Score:5, Informative)
The final link actually shows Firefox is one of the most memory inefficient browsers in heavy usage.
That depends on how you look at it. With one tab open it is comparatively poor, but with 40 tabs open it's very good.
I don't particularly think FFX has even close to the best performance, but those metrics are good. What's more important, good management with a low footprint or a high one? I have to disagree with you there.
Re: (Score:2)
That depends on how you look at it. With one tab open it is comparatively poor, but with 40 tabs open it's very good.
And in which of these states is it most likely a typical (non-Slashdotter) Firefox user will be?
Re: (Score:2)
That depends on how you look at it. With one tab open it is comparatively poor, but with 40 tabs open it's very good.
And in which of these states is it most likely a typical (non-Slashdotter) Firefox user will be?
What difference does it make?
Re: (Score:2)
The link was not labelled typical use but heavy use. Which of those states is most like 'heavy use'?
Re: (Score:2)
Re: (Score:3)
For Firefox and Safari, part of the difference is that they're 64-bit applications on Mac and 32-bit applications on Windows.
For Chrome and Opera, that's not an issue, since they're 32-bit both places.
Past that, Windows and Mac use different font and graphics subsystems. That's a pretty large chunk of memory usage right there that'll be very different. There might also be differences in allocations in various other system libraries.
Further, "the same memory allocations" can lead to very different results
Re: (Score:2)
I suspect you're not actually familiar with programming, because you're making the mistake of thinking that code is fungible, like you can easily swipe a chunk of Chrome into Opera (to choose two browsers you didn't call out specifically, for the sake of impartiality :)) and suddenly a bunch of CSS properties work.
Even in extremely modular code this won't be true of internal details like this, especially in highly optimised software like web browsers where internal data structures will generally be tuned to
Re: (Score:2)
The funniest part is that Safari for Windows probably has to load extra Apple-related libraries to run. Otherwise I wonder how they can offer Apple anti-aliasing on a Windows system.
I'd be interested to see that same test performed on a Mac OS X system. What do you mean "there's no Internet Explorer on Mac!"? Who cares!
Re: (Score:2)
Re: (Score:2)
The slides talked about firefox 12.
I honestly thought this was a joke for a few minutes, till I checked the slides myself.
Re: (Score:2)
I'm on FF 12a1; seems much better than the actual releases.
There are a few plug-in issues, but I'm not a big plugin user, so its not a big deal.
Re: (Score:2)
Citation Needed.
I am sure that many people here would like to know how you equate Ad-blocking with supporting SOPA?
Come on please tell us.
Re: (Score:2)
Citation Needed.
I am sure that many people here would like to know how you equate Ad-blocking with supporting SOPA?
Come on please tell us.
Perhaps he's Jamie Kellner [winterspeak.com], in which case the only reason I wouldn't tell him, and everybody who defends him, to go fuck themselves is that they might manage to have an orgasm in the process, and they don't deserve to enjoy themselves.
Re: (Score:2)
Actually adblock is theft. By using adblock, you support grand theft, burglars and, er, arsonist.
Re: (Score:2)
Of course it's not stupid. It's the whole reason for the feature in the first place. So that 'acceptable' ads can be shown and used to support the websites you visit. They need the money, you know. The reason it's on by default is that the ads are specially screened for their acceptability, and only ads that are deemed not annoying to users are presented.
Re: (Score:2)
I sort of agree, except it's the standard term so everyone knows what it means.
I'd see hoarding as something slightly different anyway. Application grabs memory because it needs it. Then doesn't release it when it not longer needs it. If it then reuses that memory internally next time it needs some, that's hoarding. It's not admitting that the OS might do a better job of memory management and being greedy. Same with applications that grab more than they need on startup instead of waiting for when they reall
Re: (Score:2)
So in order to stop the allocator wasting memory by using up more memory than requested, we're supposed to ask for more memory than we need? That seems to be a facepalm moment. Let's move wastage to where we can't measure it, so that we can't see any wastage any more. The bind moggles.
No, but there's a lot of times when you over-allocate deliberately so you can expand into that space. This is the key to making things like string concatenation fast (an exponential growth strategy — multiplying the space requested by a constant factor each time — gives amortized constant time for memory allocation per byte when building up by appending, which is a hugely common operation). This is fine, but since in this situation you have precise control over how much to request as you don't n
Re: (Score:2)
There is nothing intrinsic about powers of 2 that makes allocators significantly more efficient. See recent comp.lang.c discussions (last 2 weeks) about the superstitions which surrounds powers of 2, and their debunking. (O
Re:Slop analysis doesn't add up (Score:4, Informative)
See page 27 of the PDF. He explains that the allocator, jemalloc, rounds up some allocation requests to easier to handle size. He calls this wastage "slop". Then look at the final point on that page - in order to reduce slop, always allocate a power of two sized block, as those never have slop.
So in order to stop the allocator wasting memory by using up more memory than requested, we're supposed to ask for more memory than we need?
What's to stop us from changing a 1025-byte allocation to 1024 bytes, rather than 2048 bytes, as you assume? There's no reason we need round up, and indeed we usually don't.
But note that even when we do round up, it's still an improvement: The slop is rarely usable memory -- you can't use it without first calling malloc_usable_size to realize that you have any slop. But if we round 1025 up to 2048 bytes, now we have almost double the amount of memory to play with. We pay 2048 bytes either way, but when we round up, we get to use all the memory we allocated.
Re: (Score:2)
IIRC the most important part of that was allocating a standard sized bit of memory was calculated at the nearest power of 2, or 1024 bytes. Then the allocator adds a header and rounds to the nearest power of 2. So a request for 1024 bytes including slop space actually gets 2048. That was one of the biggest fixes they made - don't pre-calculate overage in multiple places, just ask for what you need until you get to the actual allocator.
This was memory designed to expand into, basically their own C-style a
Re: (Score:3)
No, you're supposed to allocate and use a power of two. If you have a 34 bytes structure and a 20 bytes structure that are usually used together, then allocating them separately will waste 42 bytes of memory. Allocating them together will waste 10 bytes. Allocate a lot of them and this 30-byte-per-structure saving is a lot.
This is even more true for buffers. The example he gave was for a JavaScript string. This allocates a buffer that the string can grow into. If a string is any length between 512
Re: (Score:2)
Dump the firefox address space to a file and check the proportion that's simply text urls.
You are aware that not all of Firefox's address space is in memory, right? I'm pretty sure that Firefox does not use hundreds of MB of RAM just for storing URLs.
Re: (Score:2)
academic work shows all urls can be coded in 4-5 bits
5 bits gives a total of 32 possible URLs, so this is only true for very small Internets...
Or do you mean 4-5 bits per character?