Slashdot Mirror


Mozilla MemShrink Set To Fix Firefox Memory

darthcamaro writes "If you're like a lot of Firefox 4 users out there, you've probably noticed that Firefox has a serious memory problem — it uses more than it really should. At long last, Mozilla developers are finally set to take this issue seriously with a dedicated team called MemShrink that are focused on the problem. 'It's pretty clear by now that this is a much bigger problem than any one person can likely tackle,' Mozilla Developer Johnny Stenback said."

41 of 375 comments (clear)

  1. bound to fail by demonbug · · Score: 3, Funny

    Any gains they make will be eaten up by the rapidly increasing version number.

    1. Re:bound to fail by MrEricSir · · Score: 5, Funny

      64 bits is only 8 bytes. An unsigned 64-bit number can take Firefox all the way up to version 18,446,744,073,709,551,615.

      So that should take them at least until through next Thursday.

      --
      There's no -1 for "I don't get it."
    2. Re:bound to fail by couchslug · · Score: 2

      I run Ubuntu 32-bit PAE, and the 4GB/process memory limit leaves me another 4GB after Firefox uses it up. :)

      --
      "This post is an artistic work of fiction and falsehood. Only a fool would take anything posted here as fact."
    3. Re:bound to fail by MobileTatsu-NJG · · Score: 3, Funny

      I consider this a Firefox problem not a version problem. I have always found that Firefox uses allot of memory.

      You're right. And the way they're going to fix that problem is they'll recruit a team of people to find out exactly where this memory usage is coming from, then they'll come to Slashdot and write posts describing how it's the user's fault.

      --

      "I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)

  2. You can fix the version number inflation too. by Anonymous Coward · · Score: 3, Insightful

    Don't be a Chrome Clone, make the next release Firefox 4.1.

  3. Easy solution by muffen · · Score: 3, Funny

    Bundle in MagnaRAM with Firefox.

  4. Re:All browsers are consuming more memory. by MrEricSir · · Score: 4, Insightful

    A lot of it's got to be the increasing size of web pages in general. Now that most folks have higher bandwidth connections, web designers don't focus on keeping the download size small.

    Multiply that increase by the size of your cache (how many times can you click "back" without hitting the disk?) and you can see the full scope of the problem.

    --
    There's no -1 for "I don't get it."
  5. Re:And probably too big... by maxume · · Score: 5, Informative

    My experience has been that both leaks and overall memory use have gone down between 3.0 and 4.0.

    At the moment, Firefox is at about 375 megabytes, with 16 tabs open. It has been open for 3 weeks. I do have browser.sessionhistory.max_total_viewers set to 3 and the anti-malware databases disabled though.

    --
    Nerd rage is the funniest rage.
  6. Re:All browsers are consuming more memory. by SimonTheSoundMan · · Score: 5, Informative

    A useful new feature in latest Nightly versions from Mozilla is about:memory. It gives you a full tree view of where the memory is being used. Of my 360MB which the browser is currently using, 101MB is JS, 46MB is storage (you back button and memory cache), 70MB on "heap-unclassified" whatever that is. JS seems to be the biggest consumer of memory.

  7. Re:not too bad by dbc · · Score: 4, Informative

    OS X here -- I usually have 8 to 12 tabs open. I almost never see memory usage below 500M, and it usually grows to about 1G after 2 or 3 hours. Firefox 4 for the Mac is seriously broken w.r.t. memory usage IMHO, and if they can't fix it fast, I'll probably be switching. I clobbers the performance of the whole system when it hogs that much memory. I'm tired of having to restart FF all the time.

  8. Re:All browsers are consuming more memory. by Seumas · · Score: 2

    That's all? 450mb? I just checked and the latest version of FF4x is currently using 2.1gb on my system.

    Anyway, I thought Firefox didn't have a memory leak? It's just how firefox is *supposed* to behave. That's what they've been saying since 3.0. You can go back to countless threads on Slashdot rehashing the same thing. "Firefox is using insane amounts of memory"... "Shut up, dumb ass, you don't know anything! It's SUPPOSED to use a gig or two!"

  9. Re:Memory problem? by arth1 · · Score: 2

    Out of curiosity, why so many tabs? Unless it's a page that will look different if you reload it, and you need to see what it was like the last time you looked, can't one just bookmark the page and open the bookmark instead of the tab? And if you already have a bookmark, just close it?
    That way, the tabs won't hog memory and CPU.

  10. Yay by OverlordQ · · Score: 5, Insightful

    At long last, Mozilla developers are finally set to take this issue seriously

    Yay, it only took 5 years of bitching for them to actually look into it instead of blaming addons or your profile.

    --
    Your hair look like poop, Bob! - Wanker.
    1. Re:Yay by sirsnork · · Score: 2

      Yup, too late to get me back, I put up with the memory usage and the random lock ups of several seconds when it was loading an intensive page all the way through version 3, when they were all still there in version 4 I switched to Chrome. I lost a few addons that I love but the grief just wasn't worth it anymore.

      --

      Normal people worry me!
    2. Re:Yay by steelfood · · Score: 2

      I'm speculating, but it wouldn't be unreasonable to thank the increased competition from Chrome for this.

      It's about time they dropped their delusions about their marketshare loss due to Chrome's features (or lack thereof) and realized it's the speed that attracts people. It was the same with IE5. Its speed made people continue to use it. Its security problems made people look for alternatives, Firefox being the popular alternative at that time, but Chrome offers both and that's why people switch to it despite the loss of functionality.

      --
      "If a nation expects to be ignorant and free in a state of civilization, it expects what never was and never will be."
  11. Pinpoint by globalist · · Score: 3, Interesting

    This is easily reproduced in FF4 when you load a page with lots of images. The mem tends to grow proportionally to the size of the images on the page. But this is the only scenariou where the mem usage is different from other browsers and needs looking into.

  12. Problem of perception? by parlancex · · Score: 3, Insightful

    I think at least part of the problem is perception. Most people seem to have this mindset that using RAM is bad, and the more memory you have free and unused the faster your computer will be. These are the same people who think they're increasing their computer's performance by turning off superfetch, etc.The problem with this perception is that it's completely stupid.

    Programs load data into memory because memory is fast and your disk and the network are significantly slower; hundreds or thousands of times slower, and pointlessly unloading the data from memory increases the risk of having to go back to the slower disk or network to retrieve it later. If you still have RAM available, it is actually detrimental to your system performance to free this data.

    Now, when you're running out of RAM there is a problem, the operating system and applications should begin to free data that is the least likely to be useful in the near future to make room for whatever is needed at the moment. If Firefox has a problem it isn't RAM usage, it's that it isn't paying attention to global system memory levels and caching less aggressively when there is RAM pressure, and honestly I wouldn't know if that IS a problem because I have way more RAM than I've ever seen my computer manage to use.

    1. Re:Problem of perception? by mrnobo1024 · · Score: 4, Insightful

      Most people seem to have this mindset that using RAM is bad, and the more memory you have free and unused the faster your computer will be. These are the same people who think they're increasing their computer's performance by turning off superfetch, etc.The problem with this perception is that it's completely stupid.

      Programs load data into memory because memory is fast and your disk and the network are significantly slower; hundreds or thousands of times slower, and pointlessly unloading the data from memory increases the risk of having to go back to the slower disk or network to retrieve it later. If you still have RAM available, it is actually detrimental to your system performance to free this data.

      If it were possible for programs to allocate caches that work like the filesystem cache, where old items get discarded automatically to make room for anything more important, then this would make sense. But in real life, when a program written with that "unused memory is wasted memory" philosophy has filled up RAM and you start another program, the first program will have to go to the swapfile. Return to it later and it'll take forever to become usable again, while it gets re-loaded 4kB at a time. (I'll usually just kill the firefox.exe process and restart it when this happens, because that's actually faster)

    2. Re:Problem of perception? by mysidia · · Score: 4, Informative

      as this amount decreases Firefox can begin to proactively free memory used for the oldest cached data.

      So your suggestion is that each application running should be fine allocating a huge cache and changing its memory footprint according to how much memory it sees available on the entire system, instead of the OS making a decision?

      I am not sure I am convinced that the outcome of that methodology is optimal. If it were; I think i'd favor "number of pages swapped in/out per second" over amount of memory free, though.

      I am trying to imagine the interactions of 4 or 5 different applications all running with a huge cache, and the same behavior.... when memory usage is low, all 5 applications prepare a huge cache -- their huge cache causes the total memory free to drop, eventually to 1MB... now, suddenly, all 5 applications will use a bit of CPU time proactively freeing up large swaths of cache -- CPU will be 100% running for a couple seconds, as processes adjust their memory.

      After all 5 apps reduce their huge caches, suddenly there will now be a lot of memory free --- so much memory free, that one or more of the applications might immediately see an opportunity for increased caching.

      So what mechanism will protect fairness? Each application will believe its cache is important, but who's to say one of the applications isn't more important to the user, or having more requests more frequently made of it (so that the user's performance will best if application X's cache is bigger versus application Y).

      There seems a fundamental weakness here, involving each application trying to make their own memory management decisions about cache --- the application making the decision to expand its cache may be the one the user cares about the least, and the one whose cache is the least useful.

      The OS is in a position to make decisions and mediate in regards to the working set needs of processes, and the user's actual usage patterns. The OS knows which running process makes the most demand of its cache -- the other processes don't know much about each other.

    3. Re:Problem of perception? by Anonymous Coward · · Score: 5, Insightful

      Using ram is 'good' and 'superfetch' are good too huh?

      How did that info get into memory. Oh thats right by me waiting for it to load from either the internet or from disk.

      Back when I used vista turning superfetch off was the #1 way to make the computer usable. Superfetch was too aggressive in loading things. Turn computer on wait 15 mins (no kidding) before I could use the start button. It was even so aggressive it would keep memory full at all times. Meaning as programs freed and used memory the disk was thrashing ALL the time. It was noticeably faster and measurable too (I measured it many times thinking guys like you must be right). Win 7 is a whole different story (it actually works).

      As for using too much memory. Using less does mean better performance. *IF* done right. But how much of that information in this case is just 'leaks'? A leak is never going to be used. Meaning windows needs to keep track of it and page it out a some point (meaning less performance at some point).

      To bury your head in the sand and say using memory is bad is stupid. But so is using it all up is good. But think about this I have open 1 tab right now to type this in. It is using 250 meg (and that is just what is paged in meaning something in the program touched it). WTF is it doing... That is a seriously crazy amount of memory to be using to have this page open which about 30k. That is some serious overhead there. From this old 80s/90s programmer I look at that and think wtf dudes. You KNOW you can do better than that.

    4. Re:Problem of perception? by mingot · · Score: 2

      Weak References do this. You are correct, though, that this is not something built directly into the operating system.

    5. Re:Problem of perception? by steelfood · · Score: 2

      That would be completely true if machines don't have any swap. Most people have a fairly large swap however--larger than their amount of actual physical memory--and on the same disk as their data.

      What this means is that the larger your footprint, the higher the chance of part of your program loading from the hard disk when you're context switching. Sure, a program with a smaller memory footprint has the same issues, but when there's less of it on disk (even if the percentage is the same), the perceived context switch time scales exponentially. The keyword is perceived of course, but that's what's important when it comes to interactivity.

      Yes, ideally, you won't hit the swap if all of your running processes fit into your existing physical memory. However, unless you're running as some kind of device driver, that's not what actually happens. Some part of your program will end up in swap so long as you have one. This is because the OS proactively moves less-often-used portions into swap in the background, to free up space for anything you might launch in the future (writing to the hard disk is more time-consuming than reading, so the OS is not going to wait until a new process comes along before it finds out you have no more physical RAM and starts writing to the hard disk--it will make sure newly launched processes will come up in a reasonable time).

      All in all, the lower your memory footprint, the better. Of course, lowering memory at the cost of increasing some kind of hard disk cache of your own is bad, and you're better off leaving it in RAM and to the OS to decide what goes into swap. That's not lowering memory, but reallocating it. But if you can actually do so, there's no reason not to reduce your footprint.

      --
      "If a nation expects to be ignorant and free in a state of civilization, it expects what never was and never will be."
    6. Re:Problem of perception? by QuoteMstr · · Score: 5, Informative

      If it were possible for programs to allocate caches that work like the filesystem cache, where old items get discarded automatically to make room for anything more important, then this would make sense

      The system you describe is called malloc()!

      In a system with a unified buffer cache (essentially, every OS in wide use except OpenBSD), it makes little difference whether a page of memory comes from a private memory allocation (e.g., a heap allocation), a memory-mapped file, or the OS's disk cache. When a process needs a page not already present in memory, the kernel's memory manager tries to find an unused page. If one is available, it hands it to the program that requested memory.

      Otherwise, it looks for an in-use page, saves its contents, and hands the just-freed page to the program requesting memory. If that page is "dirty" --- i.e., it's backed by a file and somebody's written to that part of the file, or it's a private allocation backed by the page file --- the memory manager writes the page out to disk first. If the page isn't dirty, the memory manager can just discard its contents because it knows it can reconstruct it by reading back the original file.

      When the memory manager has to go to disk to satisfy a request for a new page, it's called a hard fault. The mission of the memory manager is to reduce the number of hard faults, because hard faults are slow. The fewer hard faults you have, the less time will be spent waiting for the disk, and the faster your system will run.

      The most important part of the memory manager is page replacement: i.e., how the memory chooses what page to evict in order to satisfy a memory allocation request. Most systems use an approximation of LRU (i.e., least recently used), throwing out pages that haven't been accessed in a while. It doesn't usually matter where a page came from. The only important factor is how recently it was accessed.

      So, you can see that there's no difference between a program mapping a file into memory and modifying it, reading and writing it using file APIs, and just manipulating an equal amount of information in buffers created with malloc. To the kernel, all memory is made up of pages.

      The "go away for a while" problem isn't caused by any particular memory strategy. It's an artifact of the memory manager's LRU approach. How does it know that the pages corresponding to Firefox are going to be used again? If some other program needs those pages, the older ones will be discarded. There is nothing applications can do.

      Instead, the OS itself has to be tweaked to preserve interactivity. Sometimes the memory manager will prefer disk cache pages to malloc-backed ones. Sometimes (e.g., for Windows SuperFetch) the OS will try to identify pages belonging to activate applications and try harder to keep those in memory. Some systems favor keeping executable pages over private allocations. You can tweak the page replacement algorithm, but the basic idea, that all memory is made up of pages subject to the same management scheme, applies.

      Ultimately, it's ridiculous to hear people talk about programs "keeping things in memory" like we were still dealing with DOS 6 and OS 9. The actual situation is a lot more subtle, and silly memory counters don't even come close to giving you a good picture of what's actually going on.

      In short, don't worry about fine-tuning what's "in memory". Don't change behavior based on total amount of memory in the system. Operating systems (OpenBSD aside) ALREADY DO THAT. Just let the memory manager do its job, and give it enough information (via interactivity information, memory priority, etc.) to do its job properly. Don't try to hack around problems at the wrong layers.

    7. Re:Problem of perception? by taosk8r · · Score: 3, Informative

      I use this little restart firefox extension, kind of a cool trick.. Also config trim on minimize (google it).

      --
      -taosk8r
    8. Re:Problem of perception? by adri · · Score: 4, Interesting

      Ah, the sounds of someone spewing the 80's virtual memory rhetoric.

      There's more to it then that. I could go into it, but I'm supposed to be studying for a psychology exam, so I'll be brief.

      You assume that the OS will make sensible paging decisions. You assume you can hint to the OS that you're going to make sensible paging decisions. You hope the application, which is likely big, multithreaded and such, is doing the sensible thing of not wrapping large accesses to "memory things" (eg big trees of data, as an example, or image caches, or whatever takes up more than a small bit of RAM) in mutexes. You assume that your application is using memory in a sensible fashion, and not simply using a few bytes here and there in each allocated chunk.

      The trouble is, application writers have been taught from an "early" age that hey, memory is cheap, the OS will handle paging out unused bits, so please go right ahead and use it without caring about how it's used. This is how you end up with application behaviours which include, but aren't limited to:

      * walking a tree requires a page in (ie, a random disk read) for each tree node touched. Because each node is malloc()'ed, and although on modern implementations small objects are packed into pages, your 10,000 tree node is going to likely be spread across multiple pages based on when and how often you allocated them ('temporal location');
      * this also means your memory use versus memory allocation isn't terribly efficient ('fragmentation');
      * your mutex protected data structures are suddenly now mutex'ing _page disk access_, so whilst the OS is busy paging in your data, all other threads currently trying to do stuff that requires that mutex (which may even not require paging in) suddenly has to stop and wait for your page-in to complete.

      It's a real shame that memory management has really stopped progressing since virtual memory systems were made. They're convenient, but they hide the worst case behaviours from unknowing coders. Then those worse case behaviours become _very_ worse case behaviours which can't be changed without a fundamental rearchitecture of your software. Likely what people are realising here.

      Enjoy!

    9. Re:Problem of perception? by arth1 · · Score: 5, Insightful

      it's not designed to be open for a week straight.

      Then it needs to be redesigned.
      I do not need a server to become sluggish because a user left on vacation with Firefox still running with a detached display.
      And I do not want to have to close my munin/bigbrother/mrtg windows running on the wall monitor. It should keep running.

      Remember how we ridiculed Microsoft for Windows 95 not being able to run more than a few days without a reboot? Well, it's time we laugh at the idiotic Firefox devs who repeat the same mistakes and invalid assumptions.

      Because of the severe bloat and WTF assumptions made by the newer generation of Firefox devs, I've started using other browsers more and more. Like Midori ("it's not easy being green").

    10. Re:Problem of perception? by adri · · Score: 2

      The operating system only knows more about the state of the entire system. It can't know what the application is doing. It can't know that paging A to disk is going to hurt more than B. This is the kind of silly crap that goes on when you work on such enormously complicated bits of software that assumes that memory access is always going to be uniform, that threads never block for more than a few microseconds unless you want them to. Even the smallest bit of paging just so the OS can make room for application B to do some work suddenly makes things seem more unresponsive. The answer was always "buy more RAM." The original article seems to be developers .. figuring out they can't do that any more.

      The operating system can't see what's going on inside the application. It can't judge what to swap out. The memory allocator doesn't know this kind of stuff either. Allocators end up being written that get tuned for the average cases that applications are doing now. Seeing memory allocators written to reduce thrashing and memory use for -just mysql- is plain silly.

      Please, sit down with a system that's actually -heavily swapping-, that doesn't come back afterwards and figure out why it's so unresponsive. Then when you're wondering why the heck this is relevant for a discussion on mozilla, try running mozilla on anything that doesn't have a god ton of RAM. It doesn't just start chugging a little bit, it starts chugging a lot. For all the reasons above.

    11. Re:Problem of perception? by Sollord · · Score: 2

      I have 16GB of Ram and FF4 is using almost 4Gigs of it while also having one of my cores floored at 100%. I've had the same window open for 2 weeks and I have 48tabs open for some reason... I'll probbaly restart it soonish the CPU usage seems to be video related since Netflix is playing though it is odd only one core is pegged by just the firefox.exe yet the plugin-container.exe barely use any resources

  13. Re:All browsers are consuming more memory. by billcopc · · Score: 2

    It probably means memory allocated by the JS interpreter itself, whereas "storage" is more of a file and bitmap cache. Just guessing here (though I have hacked on Firefox code in the past).

    --
    -Billco, Fnarg.com
  14. Needs to be all of Mozilla by binarybum · · Score: 4, Insightful

    I hope this isn't just targeted towards firefox. Thunderbird is an unwieldy beast of an email app as well. No good reason that checking my email should involve consuming 200Mb of memory.

    --
    ôó
    1. Re:Needs to be all of Mozilla by dkf · · Score: 2

      I hope this isn't just targeted towards firefox. Thunderbird is an unwieldy beast of an email app as well. No good reason that checking my email should involve consuming 200Mb of memory.

      There is a separate issue there with levels of caching of information; with some IMAP servers (notably Exchange — boo! hiss! — which I happen to be stuck with, and most of the workarounds listed out there on the 'net are outdated with recent Exchange installations as they rely on functionality that MS withdrew) there's a problem with the code that decides whether a mailbox has changed in an incompatible way and which results in a mailbox being downloaded repeatedly despite no change at all. I've seen it claimed that this is due to disagreement over the interpretation of parts of the IMAP spec, but I'm not able to really care about that side of things, and the fact that it causes memory use to bloat massively when it happens is a Bad Thing in any case.

      The best workaround I've found so far is to reduce the size of the mailbox (local mailboxes don't have the problem). I don't feel that this in any way indicates that things are fixed. Just that there is a way to cut the pain down.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
  15. Re:All browsers are consuming more memory. by MrNemesis · · Score: 2

    Wish I had mod points for you. But you also forgot to mention the people who say "Shut up dumb ass, you've clearly got a shitty system and/or are incompetent!" or the "Shut up dumb ass, you're obviously using the wrong/too many extensions!" as well as the "Shut up dumb ass, you've got too many tabs open" and the "Shut up dumb ass, you're not meant to keep it running for days!" crowd.

    To those of you who can manage to open a hojillion tabs and keep them open for months at a time, congratulations, we're happy for you. But as a user whose firefox at work will routinely gobble 350MB just with my opening set of tabs, then go up to 700MB after a few hours usage, and then at some point in the next few days will start chomping like there's no tomorrow and eventually crawls the OS and then crashes when it hits 1.8GB (32bit limit), please take our word for it when we see Firefox having a problem. I can close up a whole bunch of tabs and only regain a few megabytes, I can close every tab and only regain a hundred or so megabytes... on machines with "only" 2GB of RAM you *need* FF to relinquish that memory. I've got nothing against apps using the memory that's there, but FF often behaves like it owns the OS, mallocing away whilst pushing other running apps out to swap.

    It's nice to finally see what appears to be the beginnings of a concerted effort to address whatever combination of factors there are that contribute to the issue... but I do fear it's too little too late for a lot of people who've already jumped to chrome. (Personally, opera's been my primary browser since well before firefox was phoenix but it doesn't play well with the work proxy... it too can eat up vast chunks of memory if you throw enough gunk at it but I can always reclaim that memory by closing down a few tabs)

    Not intended as a troll or a dig against FF itself, it's just frustrating sticking your hand up and saying "Hey! Got a memory problem here!" and be met with a barrage of assertions from people you've never met who insist that you must somehow be stupid, blind, mentally retarded or some combination of the above just because the same circumstances have never happened to them.

    --
    Moderation Total: -1 Troll, +3 Goat
  16. Re:All browsers are consuming more memory. by bill_mcgonigle · · Score: 2

    A useful new feature in latest Nightly versions from Mozilla is about:memory. It gives you a full tree view of where the memory is being used.

    Is this per-tab or global?

    I need a 'top' like function for Mozilla that will tell me which tabs are using resources (usually a flash object that snuck by me).

    Does FF5 let me use 'top' proper with per-page processes?

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  17. Re:All browsers are consuming more memory. by bill_mcgonigle · · Score: 2

    Oh, come on now, Netscape 4 would have taken at least half a megabyte to show those pages!

    Wait, that wasn't a good argument.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  18. Re:All browsers are consuming more memory. by blacksmith_tb · · Score: 2

    Not just for nightlies any more - try it in the current 5.0b5 beta!

  19. FF is not the problem.... by FlyingGuy · · Score: 2

    he problem is with programmers.

    We all remember when every byte of ram used was worried about because RAM was a precious resource.

    Now we have programmers who have drank the kool-aid of "Hey Ram is CHEAP and programer time is expensive.

    Need another feature? Oh just compile is some humongous library that some other guy wrote that is so poorly written that not even the smartest linker can avoid linking in every dam line since every thing is interdependent on everything else.

    This is objects gone insane. Need another property, another method, just pile it on, don't waste time refactoring the code so that you get what you need with the smallest footprint you can get.

    Programmers need to re-boot their brains and start coding like memory is a precious commodity because it IS when everyone wants to have 100 tabs open in their browser, plus eclipse, plus gimp, plus this plus that plus the other and do all of this when re-compiling the entire Linux kernel.

    --
    Hey KID! Yeah you, get the fuck off my lawn!
  20. Re:Let's do a test by Dwedit · · Score: 3, Interesting

    Looks like the Url Classifier (worthless anti-phishing feature) is eating up a fair amount of resources for nothing.  You look in your user profile, and you see the urlclassifier3.sqlite file keep getting bigger and bigger for no real reason, and you see that Firefox needs 24MB of RAM just to have it loaded and working.

    Here's my list (sorted top 25, but may be misleading since some of the numbers look like sums of others)

    win32/workingset                             432,160,768
    win32/privatebytes                           420,995,072
    malloc/committed                             376,307,712
    DescriptionValuemalloc/allocated             354,080,976
    storage/sqlite/pagecache                     79,423,848
    js/gc-heap                                   66,060,288
    storage/places.sqlite/Cache_Used             52,400,928
    storage/urlclassifier3.sqlite/Cache_Used     24,250,888
    js/string-data                               7,282,684
    layout/all                                   6,261,185
    images/content/used/raw                      4,043,747
    images/content/used/uncompressed             3,444,586
    gfx/surface/win32                            3,398,208
    storage/sqlite/other                         1,589,512
    malloc/dirty                                 1,097,728
    js/mjit-code                                 913,507
    storage/cookies.sqlite/Cache_Used            528,376
    storage/formhistory.sqlite/Cache_Used        508,664
    storage/extensions.sqlite/Cache_Used         494,144
    storage/addons.sqlite/Cache_Used             362,512
    content/canvas/2d_pixel_bytes                360,000
    images/chrome/used/uncompressed              353,440
    shmem/allocated                              344,064
    shmem/mapped                                 344,064

  21. Re:All browsers are consuming more memory. by BZ · · Score: 3, Informative

    There are several things going on here:

    1) JS JITs. These optimize for speed of compilation and speed of generated code; small size of generated code is not really something being optimized for except insofar as it helps one of the other two metrics. In the case of Firefox, just deciding to JIT a little less aggressively late in the 4.0 cycle saved a good bit of memory when JS-heavy pages are open.

    2) Images. Sites are using more and more bigger images, in addition to larger and larger scripts. With images you have the options of decompressing on draw (slow, typically) or storing decompressed images in memory (uses lots of memory). Guess which one browsers are typically doing?

    3) Leaks in webpages. By this I mean web pages that allocate more and more JS objects and have them all reachable (e.g. by sticking things in an array that's hanging off the Window) so the web page uses more and more memory. gmail did this until recently; they were working on fixing it last I checked. This means that if one of your "few tabs" is gmail and you've had it open for a while a lot of that memory could be actually being used by gmail.

    about:memory in Firefox is being improved to make it easier to answer the "what's using the memory" question, at least....

  22. Fix goddamn xulrunner/flash please! by The+Master+Control+P · · Score: 2

    With me it's never Firefox per se that does it, it's xulrunner and flash.

    Computer's ground to a halt?
    Hard drive paging like a mofo?

    Why yes, xulrunner and flash are using 90% of all physical memory. Yet again. And I have flash-control plugins that only start the flash apps I say to start.

  23. Site authors too by augustm · · Score: 2

    There is the problem of web sites too- one popular site generates mountains of of javascript garbage every times you
    scroll. See for instance the bug 656347 in the mozilla database.

    The site? Slashdot. Mozilla is not happy the way Firefox manages this, but relying on garbage collection
    very time you push arrow down is bad.

  24. Re:All browsers are consuming more memory. by Seumas · · Score: 2

    I haven't paid much attention to memory usage on Firefox in a long time, until I saw this article, because while it still uses a lot, it stopped causing it to crash like it used to. Sure, it still crashes, but a couple times a month rather than every hour or two, like it did prior to 3.6. However, the last time I watched memory usage on Firefox (both on OSX and Windows; didn't have FF running on linux), I could just sit there and watch the memory utilization increase by about a quarter of a megabyte per second. I could watch it for hours and it would just keep climbing, indefinitely.

    I probably use more tabs than the average person, but I don't think that necessarily explains why an idle browser should continue to increase in memory usage for hours after the last page or tab was opened. I also don't understand why there isn't a more sane way of handling tabs. Why does every tab need to remain in memory? If I have a group of tabs that I haven't switched to or touched in three hours (or days, for that matter), it seems maybe those could be written to disk and the tab would consist of just a simple screenshot for display in Panorama/Tab Candy mode?

    I've seen the behavior on multiple systems, even without any extensions installed. Like I say, I can understand high memory usage if you have an obscene number of tabs open (though I think there should be better ways of handling those tabs than keeping them all in memory), but I don't think it explains why an otherwise idle browser should increase in memory usage hours after it was last touched.