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."

375 comments

  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 Anonymous Coward · · Score: 0

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

    3. Re:bound to fail by CTU · · Score: 0

      What about chrome? I think google is going to run out any day now.

    4. Re:bound to fail by blair1q · · Score: 1

      void *myHeap = malloc( get_version() * 100 * MEG ).

      Three opportunities to reduce total memory usage, there.

    5. Re:bound to fail by Anonymous Coward · · Score: 0

      That's when they pull a Squaresoft/Apple routine and start double numbering shit a la Final Fantasy X 2 and Mac OS X 10.

      Chrome 14 5

    6. 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."
    7. Re:bound to fail by taosk8r · · Score: 1

      I'm really pissed about this, my extensions are now going to break like 5x as often I think.

      --
      -taosk8r
    8. 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)

    9. Re:bound to fail by seandiggity · · Score: 1

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

      I know this is supposed to be a joke, but the first thing this actually made me think of was the havok a fast-paced rolling release schedule could do to an effort like this.

      --
      Geeks like to think that they can ignore politics, you can leave politics alone, but politics won't leave you alone.-rms
    10. Re:bound to fail by Anonymous Coward · · Score: 0

      They now have a committee.
      The next step is deciding on the inner crap of FF.
      Result will be the new, slender AshCamel (formerly known as Firefox)

    11. Re:bound to fail by Anonymous Coward · · Score: 0

      I don't see how this is bound to fail especially when chrome already uses way more ram than firefox ( 2~3 times more)

    12. Re:bound to fail by Hazel+Bergeron · · Score: 1

      void *myHeap = (free(malloc( get_version() * 100 * MEG )), &myHeap);

      Did I do it right? One word should be enough for any man.

    13. Re:bound to fail by Anonymous Coward · · Score: 0

      "An unsigned 64-bit number can take Firefox all the way up to version..."

      Yes, but Mozilla would never use unsigned numbers. Publishing versions without full digital signatures is bad security practice.

    14. Re:bound to fail by Anonymous Coward · · Score: 0
    15. Re:bound to fail by Anonymous Coward · · Score: 0

      Although your comment is correctly modded 5 funny, let me fix it for you.

      64 bits is only 7 bits. 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.

    16. Re:bound to fail by aminorex · · Score: 1

      Given that there are 1.86e46 planck time per second, they might not make it to Thursday. And that's assuming no version skips.

      --
      -I like my women like I like my tea: green-
    17. Re:bound to fail by kwoff · · Score: 1

      or "alloc"

    18. Re:bound to fail by Anonymous Coward · · Score: 0

      My good man, you are entirely too optimistic.

  2. And probably too big... by Kjella · · Score: 1

    ...for one post-hoc team to fix after the rest have gone on a rampage. Still, I suppose it's better than not having such a group.

    --
    Live today, because you never know what tomorrow brings
    1. Re:And probably too big... by BadAnalogyGuy · · Score: 1

      Does it even matter as Mozilla-based browsers become less important as Internet usage moves towards Webkit-based browsers on mobile devices?

    2. 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.
    3. Re:And probably too big... by mooingyak · · Score: 1

      Same experience here, and without using either of those settings. FF4 is still a hog, but not nearly as bad as FF3 was. I would restart FF3 after I'd left it running for more than 2 days. FF4 seems to get me closer to 5 or 6 days before I notice a problem.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    4. Re:And probably too big... by maxume · · Score: 1

      I have 900 megabytes of physical memory not doing anything. I'm fine with Firefox using 400 megabytes, it isn't a problem.

      --
      Nerd rage is the funniest rage.
    5. Re:And probably too big... by hedwards · · Score: 1

      Are they though? I keep hearing anecdotally that people are switching in droves from Firefox to Chrome, but considering most of it is due to things like memory use and speed, I can't help but think that the numbers are exaggerated. For one thing Firefox has been using less RAM than the competition for quite some time now. And for another thing, Firefox, unlike many of the competitors, chrome I'm looking at you, is actually a full featured browser which is relatively stable. There's not a lot of cruft being added, I can't say the same for some of the more minimalist browsers out there.

    6. Re:And probably too big... by Anonymous Coward · · Score: 0

      Strangely, on my end Firefox 4 uses *more* memory than 3. I never had much problem prior to 4.

    7. Re:And probably too big... by Anonymous Coward · · Score: 0

      That's the issue, its the same here whether I'm on my him PC with 4gb or at work with one. Add last.FM or pandora to the mix and plugincontainer wants 100 megs more. That behavior is fine with a good PC but sucks at work. Throw in Norton AV and the work computer is useless. Seriously useless.

  3. All browsers are consuming more memory. by SimonTheSoundMan · · Score: 1

    I do not mean to sound like a troll, but it seems all browsers are consuming more and more memory. Chrome being the worst (due to every tab being sandboxed?), Safari is equal to Firefox.

    Why is memory usage increasing so much in recent years? Firefox is currently consuming 450MB on my machine with only a few tabs open.

    1. 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."
    2. 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.

    3. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      Using an older laptop with 512MB of DDR for most of my web browsing, I can say that Firefox is still worse off than Chrome. I use Chromium for most of my web browsing, Opera is better about memory usage but not having an adblock extension makes it unbearable to use for long periods. Adblock is much more convenient than keeping a hosts file up to date, I'm afraid.

      Anyway, 10 tabs is my maximum with Opera. 7 Chromium. 5 Firefox. I don't have numbers on memory usage in front of me, but these are the limits before swapping makes the laptop unusable. Maybe with the Windows (or Mac) versions of these browsers things are different?

    4. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      No one cares about additional per-tab memory (insignificant as it is due to copy-on-write mapping) because that only raises the minimal static mem usage: memory 'leaks' are more at issue because they (usually) endlessly grow the storage space.

    5. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      You think that's bad. I have a project at work where I have to spawn firefox windows from selenium to test websites. Every three days I have to reboot the system due to the memory usage. It's 32bit freebsd and I had 3.5GB of SWAP + 3GB of RAM used with 85 firefox windows open in KDE. I could barely reboot. Selenium has a "feature" where it opens a new "monitoring" window everytime start is called and i have a loop restarting when firefox crashes from too many page requests thus the high number.

      In 3 weeks, I've tested 620,000 pages.

    6. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      look at the content in those tabs. The flash, the large pretty images, the flash movies, etc.... compaired to 10 years ago when such content did not exist, i would say a large part of the increased memory usage is due to the increased size of web content due to the increased bandwidth we now enjoy. With that said, this effort is still a good idea, as memory usage is a tad high (100+mb with one tab [google] open is a tad excessive).

    7. 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!"

    8. Re:All browsers are consuming more memory. by PCM2 · · Score: 1

      Why is memory usage increasing so much in recent years? Firefox is currently consuming 450MB on my machine with only a few tabs open.

      I just checked and ... you're right. Same here (Windows 7 x64). I have eight tabs open, memory usage is 450MB and counting. And I can just sit here and watch Firefox's memory usage slowly go up... and up... and up... while I do nothing. What's more, some people I know have a habit of leaving the browser running for days with hundreds of tabs. Not me. I'm so old fashioned that not only do I put my computer to sleep when I walk away from it, but I actually close all my running apps before I do so. So Firefox is never running on my machine for more than, say, 18 hours, maximum.

      --
      Breakfast served all day!
    9. Re:All browsers are consuming more memory. by YutakaFrog · · Score: 1

      Although I agree that browsers in general are "consuming more and more memory", I'm seeing a slightly different story than you are. I abuse Firefox 4's new tab grouping functionality horribly, and keep tons of tabs open regularly. I use to have to pare them down just so I had room to read the titles on my tab bar, but now I can have upwards of 50 tabs open at a time.

      Right now, I've only got 15, including my 5 pinned "App Tabs" (Four Google apps + FB). My Firefox is consuming 475 MB.

      I was curious, and decided to see how much RAM Internet Explorer 9 would take with the exact same 15 tabs open. It appears to have spawned four child processes totalling approximately 1,283 MB.

      My data: http://i51.tinypic.com/fualq0.jpg (Sorry, no pic of the tabs I've got going, you'll just have to believe that I really did open all the same tabs)

      And yes, I should include data for Opera and Chrome, but I didn't have those installed, and want to get this posted in time for a chance at being modded up. ^_^

      Personally, for how extensible, and how many great features Firefox brings to my online life, I've never considered its memory consumption unreasonable. And it certainly appears to be doing better than the competition.

    10. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 1

      What part of 'older laptop' don't you understand? Not all memory is as cheap as DDR3. Not all laptops can be expanded much in memory. Older ones especially...

    11. Re:All browsers are consuming more memory. by Mad+Merlin · · Score: 1

      To be honest, Firefox could be using double the amount of memory it currently does, and I wouldn't care. Firefox's biggest problem is that its performance isn't consistent. Use it for any amount of time and you'll notice that quite frequently the entire UI will freeze for long periods of time (0.5s-1s) for unknown reasons, which is extremely annoying. I don't care what it's doing, it shouldn't be freezing the UI. No, I don't have any extensions (except Firebug, which is Firefox's only compelling feature). And no, this isn't slow hardware, it happens on every copy of Firefox I've ever used, even on a quad core i7 with 12G of RAM.

    12. Re:All browsers are consuming more memory. by MrEricSir · · Score: 1

      That's odd that they're making a distinction between Javascript and "storage." After all, isn't (most) Javascript associated with a specific page?

      --
      There's no -1 for "I don't get it."
    13. Re:All browsers are consuming more memory. by YutakaFrog · · Score: 1

      I should also note that I keep Firefox open, about 18 hours per day, every day, and I hibernate my computer at night with FF still open. So it doesn't get rebooted very often, it hardly ever crashes, and it's still only consuming 475 MB. I don't know why so many other people are seeing 450 MB for one or two tabs. Maybe it's my computer?

      Win 7 Pro on a Phenom II X4 940 3.0 GHz with 8 GB of RAM.

    14. Re:All browsers are consuming more memory. by blair1q · · Score: 1

      "Why is memory usage increasing so much in recent years?"

      It's always been increasing. There's nobody tracking it (maybe; I'm sure the interwebs can find someone going all OCD over it) as there's no Moore's Law for Memory Usage to be kowtowed to every time it increases, but the design of OO code libraries means that enormous things can be hidden behind a simple instantiation.

      The solution is more orthogonality, but software is fairly fractal, so if your program has a very rich feature set (and browsers are tantamount to the kitchen sink, to the point they're ready to supplant the OS) it will access most of the available functionality of the system you're running on and the libraries installed in it. And it will create and retain lots of internal data for easy access while the program is running. Huge buffers and lists.

      Running things that open several fully-featured windows in process-per-window modes just means that you can't reuse code between object instances, so you end up with duplicates of big libraries and data sets for each of those domain instances.

      As for Firefox itself, it seems to have the most bloating when loading large Javascripted pages (Facebook game apps are possibly the worst offenders, even ones with pathetically simple user-interface semantics). Not sure how much of that Mozilla devs can cure.

    15. 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
    16. Re:All browsers are consuming more memory. by Ethanol-fueled · · Score: 0

      My older laptop with the same amount of memory runs with no glitches and lagging because I don't feel the need to upgrade to the latest and bloatiest version of everything, including Firefox and the Linux operating system on which it runs.

    17. Re:All browsers are consuming more memory. by The+MAZZTer · · Score: 1

      Storage refers to cookies, local/sessionstorage JS APIs, and the WebDB APIs.

    18. Re:All browsers are consuming more memory. by The+MAZZTer · · Score: 1

      Whoops, that's actually Chrome's definition. It seems like Firefox is looking at its SQLite databases which it uses to store profile data.

    19. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      That AC isn't me, the original old hardware AC. As I said earlier, it's DDR. Not DDR2. I've also found older laptops to be much more reliable hardware-wise than newer ones, I have an old Toshiba Satellite with a Pentium stashed in my closet that works fine.

      This Gateway 6510GZ is what I'm using, and I'm not the least bit surprised it hasn't died, personally.

    20. 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
    21. Re:All browsers are consuming more memory. by petermgreen · · Score: 1

      70MB on "heap-unclassified" whatever that is

      It probably means exactly what it says, heap* allocations that haven't been marked as anything in particular.

      * The heap is where allocations made with the likes of malloc and similar constructs are allocated from (contrast with the global variables which have fixed locations and the local variables which are located on the stack).

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    22. Re:All browsers are consuming more memory. by Huntr · · Score: 1

      I think that's about right and if I had mod points I'd give you some. I've been an Opera devotee for 12-13 years. Opera has always been pretty good at memory management, IMO, but nowadays, it uses as much as the next browser. Right now, 6 tabs open for the last 2 hrs and I'm sitting at about 512 megs used. Of course, it doesn't seem to be as big a deal when systems are built with 6-8 gigs minimum as the standard. Even so, I'm still relentlessly concerned about every spare resource my rig uses.

    23. Re:All browsers are consuming more memory. by Raenex · · Score: 1

      JS seems to be the biggest consumer of memory.

      Good to know. Less memory usage, yet another benefit of running NoScript.

    24. Re:All browsers are consuming more memory. by Randle_Revar · · Score: 1

      >SQLite databases which it uses to store profile data.

      Which would include, among other things, "cookies, local/sessionstorage JS APIs, and the WebDB"

    25. Re:All browsers are consuming more memory. by Randle_Revar · · Score: 1

      My SeaMonkey nightly (probably similar to FF5, or did they branch with 4?) is 1.8 GB Res and 2.8 GB Virt on Linux, but I am well north of 100 tabs right now...
      Still not hitting swap 90% of the time with 4GB RAM and Awesome WM

    26. Re:All browsers are consuming more memory. by Randle_Revar · · Score: 1

      50 is small time, I was running that many sometimes during the Mozilla 1.7 timeframe (FF of that time would have choked to death).

    27. Re:All browsers are consuming more memory. by equex · · Score: 1

      FF4 with only two slashdot tabs open takes 290MB here + the plugin-container.exe wich is 190MB, been open for a couple of hours before that with a bunch of youtube videos playing.. I think that is pretty much a leak right there.

      --
      Can I light a sig ?
    28. Re:All browsers are consuming more memory. by hairyfeet · · Score: 1

      Yeah that is the other thing that gets to me, what EXACTLY is FF doing that the memory keeps going up even when I'm not touching the thing? What finally got me to switch to Comodo Dragon (Chromium based) over FF 4 was I had just opened my usual tabs on the little nettop I use as a low heat/low power browser at the shop (a little Athlon XP with 2Gb I got off a customer) when I got called away to the phone. One thing led to another and I ended up busy for the better part of the day, and when I finally get back to the machine about 5 hours later FF is slamming the swap so hard I ended up having to do a hard shutdown and the thing is I had JUST opened it when I walked away, and it was only like 5 tabs! WTF?

      I really hope they fix this thing, but after so many times being told "FF doesn't have a problem its just you" I'm not holding my breath. I've done the same thing with Dragon and when I've come back the machine has been how I left it, no real memory changes. WTF is FF doing that the memory climbs when you aren't even touching it?

      --
      ACs don't waste your time replying, your posts are never seen by me.
    29. 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)
    30. 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)
    31. Re:All browsers are consuming more memory. by hedwards · · Score: 1

      Firefox doesn't have a memory leak. Or at least none of any note. I'm curious how you're managing to use 2.1gb of RAM, I have yet to see my copy on Windows, Linux or FreeBSD manage that. I rarely if ever see the browser use more than 300MB.

      It definitely could happen, but I'd want some indication that it's the browser itself and not the typical assortment of plug ins.

    32. Re:All browsers are consuming more memory. by RebelWebmaster · · Score: 1

      Those hangs are probably GC pauses, which ironically would be tied to memory usage :-)

    33. Re:All browsers are consuming more memory. by Nick+Nethercote · · Score: 0

      Is this per-tab or global?

      It's global memory usage at the moment. I'm working on https://bugzilla.mozilla.org/show_bug.cgi?id=661474 which will give JS memory usage per "compartment", which roughly means "per domain". So if a page at foo.com has a Twitter feed and some Google Analytics stuff, there'll be three compartments, one for foo.com, one for twitter.com, and one for google-analytics.com. It's not quite per-tab, but in that direction. about:memory is evolving, keep an eye on it.

    34. Re:All browsers are consuming more memory. by leptons · · Score: 1

      I use firefox 3, 3.x, and 4 on both macs and pcs, along with most other browsers including chrome and IE on a daily basis to test websites. chrome gets up to about 80MB max, IE comes in at around 100MB or so, and FF (any version) typically climbs up to 1.5GB to 2GB, and slows the machine to a crawl until I restart FF. this is not normal behavior for any type of software. the browsers are all running the same website in a similar number of tabs, and I have to restart FF several TIMES A DAY, not weeks as some people suggest. all things being equal, FF has a SERIOUS problem with RAM usage, and I applaud the devs for finally listening to the many, many complaints about this.

    35. 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!

    36. 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....

    37. Re:All browsers are consuming more memory. by kermidge · · Score: 1

      I'm gonna have to start watching what FF does - I haven't noticed any problems since I put 8GB RAM in. This is one of the larger interesting threads I've read here in a while. I hope I might even be learning something, but the last time I did much coding and had to consider malloc() and such was with GFA Basic 3.5u about ten years ago. Memory use and management has long been of interest, tho, going back to writing stuff on an Atari 800 with 48k. I just looked at my memory use. Opera with seven tabs is taking the most, ~275MB, followed by Steam just sitting idle at 149, and compiz at 128. Apart from BOINC (65MB) using three of six cores, that's all of my stuff running - the rest is OS (Ubuntu 11.94 x64) and total RAM used is around 1.6GB. No swap used. That said, I have had problems with FF and a few other programs on earlier machines with half- to one GB RAM, so I'll definitely be interested to see what the MemShrink team puts together. [and I really have to learn how to get paragraphs in posts here]

    38. Re:All browsers are consuming more memory. by The+Dawn+Of+Time · · Score: 1

      Maybe you don't get to be cutting edge anymore? It's not like you have some right to continue using old hardware forever but get the most up-to-date experience.

    39. Re:All browsers are consuming more memory. by pjbgravely · · Score: 1

      Remember that each instance of Chrome uses shared memory with the other instances. For me this is far less than Firefox. Too bad there isn't no-script for Chrome, otherwise I would run it.

      --
      Star Trek, there maybe hope.
    40. Re:All browsers are consuming more memory. by darrylo · · Score: 1

      Nope, FF4 definitely has some memory issues. It doesn't matter if it's a real leak or a matter of memory not being freed, but people are definitely seeing process growth over time. Here's one example for windows: https://bugzilla.mozilla.org/show_bug.cgi?id=645633

      Things to note:

      1. This is reproducible on a fresh/brand new/vanilla installation of FF4. No extensions are needed. None. It depends upon the URLs visited; unfortunately, gmail seems to be one of them.
      2. Due to way FF is designed, the process size will grow somewhat over time. However, the size should eventually stabilize (stop growing). In some cases, unfortunately, the process size just grows and grows. I've personally seen an average growth of around 1MB/minute. This may not seem like a lot, but it's an huge issue if you leave FF4 running all the time.
    41. Re:All browsers are consuming more memory. by Malc · · Score: 1

      Sounds possibly useful to web developers, but not at all to end users. This whole thing would be solved simply if Mozilla would hurry up and bring FF in to the modern browser age with a multi-process implementation

    42. Re:All browsers are consuming more memory. by Malc · · Score: 1

      Wrong level of granularity for me. Tell me which pages/tabs/windows are consuming the most memory, and I'll consider closing them. For me, JS isn't the biggest problem. The following about:memory from Firefox 4 on my Mac isn't much use to me. Has it improved in the nightlies? Unless you can demonstrate why, I couldn't care less about malloced memory. I just want to know which tabs to kill, or how much is in cached recently closed tabs, etc. I don't see Firefox helping with. Google does it much better with Chrome. In fact with Chrome and IE I can make a guess based on process information without overly detailed browser memory reports

      Overview
              Memory mapped: 505,745,408
              Memory in use: 371,368,272

      Other Information
              Description Value
              malloc/allocated 371,375,024
              malloc/mapped 505,745,408
              malloc/zone0/committed 368,321,568
              malloc/zone0/allocated 463,474,688
              js/gc-heap 101,711,872
              js/string-data 4,967,696
              js/mjit-code 8,063,468
              storage/sqlite/pagecache 74,703,280
              storage/sqlite/other 2,188,744
              images/chrome/used/raw0images/chrome/used/uncompressed 527,096
              images/chrome/unused/raw0images/chrome/unused/uncompressed0images/content/used/raw 5,760,063
              images/content/used/uncompressed 3,856,569
              images/content/unused/raw 5,620
              images/content/unused/uncompressed 17,440
              layout/all 11,927,351
              layout/bidi 5,666
              gfx/surface/image 4,614,336
              shmem/allocated 1,888,256
              shmem/mapped 1,888,256
              content/canvas/2d_pixel_bytes 1,091,584

    43. Re:All browsers are consuming more memory. by klui · · Score: 1

      FF 5 beta buildID 20110608151458

      Overview
                              Memory mapped:153,092,096
                              Memory in use:147,875,008

      The largest I can see that I think I could control are:

      storage/sqlite/pagecache 47,601,304
      storage/places.sqlite/Cache_Used 45,047,832

      FF 2 and 3 had an easy way to change the retention period but I guess they removed it for 4 and 5? http://kb.mozillazine.org/About:config_entries doesn't say if the history preferences are applicable to 4 and 5 anymore. I'm also using the portable version of beta 5 so the cache in Advanced > Network : Offline Storage, Limit cache to X MB of space is 0.

      Anyone know what to change that affect those two storage properties? I prefer maybe 30 days' worth of history.

    44. Re:All browsers are consuming more memory. by zlogic · · Score: 1

      All the "Facebook Like", "+1" and "Post to Buzz" buttons are placed in iframes. Some browsers (e.g. chrome) isolate these iframes from the rest of the page (for protection from XSS?), and each button in Chrome takes about 8-20 megs of RAM. Since some websites put tens of these buttons, a single webpage can take up to 200-400 megs of RAM.

    45. 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.

    46. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      "Why is memory usage increasing so much in recent years?"

      It's always been increasing. There's nobody tracking it (maybe; I'm sure the interwebs can find someone going all OCD over it) as there's no Moore's Law for Memory Usage to be kowtowed to every time it increases

      Parkinson's Law of Data: prov. “Data expands to fill the space available for storage”; buying more memory encourages the use of more memory-intensive techniques. (The original 1958 Parkinson's Law described the structural tendency of bureaucracies to make work for themselves.) It has been observed since the mid-1980s that the memory usage of evolving systems tends to double roughly once every 18 months. Fortunately, memory density available for constant dollars also tends to about double once every 18 months (see Moore's Law); unfortunately, the laws of physics guarantee that the latter cannot continue indefinitely.
    47. Re:All browsers are consuming more memory. by Rockoon · · Score: 1

      The problem really isnt so much that 512 MB is being utilized.. the problem happens when that 512 MB has to be swapped out and back in again, and I think Opera wins hands down here vs Firefox. The only time I have seen Opera become unresponsive is when it crashes, which itself is extremely rare.

      Firefox becomes unresponsive and also brings the performance of the entire system down with it when memory pressure exerts itself. As others have already noted, its almost certainly due to lots (tens or hundreds of thousands) of small malloc()'s that behave extremely poorly when memory pressure does finally exert itself.

      My suspicion is that Mozilla will eventually rewrite the browser from scratch... oh.. wait... they tried that.. maybe the problem is the developers.

      --
      "His name was James Damore."
    48. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      Unfortunately, Firebug has memory leaks out the wazoo, so that's probably at least half of your problem.

    49. Re:All browsers are consuming more memory. by blair1q · · Score: 1

      unfortunately, the laws of physics guarantee that the latter cannot continue indefinitely.

      Depends on which laws of physics you apply. The law has been jiggered a few times to account for paradigm shifts. It used to be all about transistors on a chip. Now it's about gross performance metrics. People keep finding ways to make the results of innovation follow the pace Moore observed.

      It's been a long time since I've seen a system that was full, btw. Even bloat-champ Firefox seems to use less than 25% of a typical computer's RAM. Pretty sure Parkinson was working at a time that innovation in software was way ahead of innovation in storage. Now companies that make hardware have become drivers of software use-cases to create demand for their output. I think someone mentioned it already, but Mozilla's best strategy here might be to just buy everyone another gig of memory.

    50. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      whoa, something seriously wrong with your setup in that case.

      I have a P4 with 1gig ram, and Firefox 4 never freezes, except if I start the browser and recover a session with 10 youtube tabs open (and the freeze in that case is only because of the slowness of the cpu :)

      You might want to think about creating a new profile to test if that might be the issue, launch with: firefox -profilemanager

      I currently have 20 tabs open, and it's consuming 350meg ram, and 300meg paging.
      Not bad, compared to Firefox 3.

    51. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      Using an older laptop with 512MB of DDR for most of my web browsing, I can say that Firefox is still worse off than Chrome. I use Chromium for most of my web browsing, Opera is better about memory usage but not having an adblock extension makes it unbearable to use for long periods. Adblock is much more convenient than keeping a hosts file up to date, I'm afraid.

      Anyway, 10 tabs is my maximum with Opera. 7 Chromium. 5 Firefox. I don't have numbers on memory usage in front of me, but these are the limits before swapping makes the laptop unusable. Maybe with the Windows (or Mac) versions of these browsers things are different?

      Opera has an adblock extension. Seriously, update man.

    52. Re:All browsers are consuming more memory. by DMUTPeregrine · · Score: 1

      And in the current stable, 4.0.1. It's been around for a while.

      --
      Not a sentence!
    53. Re:All browsers are consuming more memory. by Anonymous Coward · · Score: 0

      heap-unclassified is whatever hasn't been marked as where it belongs in the tree yet. In the product I work with (not Mozilla), we classify the usual troublemaker allocations, but never spent the time tracking every byte, instead just provide a rule of thumb that the number should be below some accepted level. If it's not, then we start classifying again.

    54. Re:All browsers are consuming more memory. by mcgrew · · Score: 1

      I ran across this comment while metamoderating. I don't know about Firefox, but at work I'm forced to use IE6 (I'm on FF on kubuntu right now). With a dozen slashdot windows open it uses a few hundred megs of swap apace, if Windows' task manager can be trusted, but a dozen Yahoo news windows and the graph shoots up way past two gigs.

      BYW, is there a similar Linux program? I'd like to see how the computer I'm using now looks, but there aren't any MS products here at home.

  4. At last by Anonymous Coward · · Score: 0

    This has been an issue for years, I've noticed memory usage problems since FF 1.0, and although users now generally have enough RAM to handle it, it's good that it'll likely be fixed at last

  5. 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.

  6. .. yet still less than Opera by Anonymous Coward · · Score: 0

    I switched to Opera for a bit because I was having problems with Firefox crashing, and found that it uses even more memory than Firefox.. but memory is cheap these days, and both browsers seem to perform fine.

  7. not too bad by hey · · Score: 1

    I love Firefox. I don't think it takes too much memory. Sure it could use more but its not so bad. Right now for example its using 128M (after being open for days) on a 4G machine which is fine.

    1. Re:not too bad by Anonymous Coward · · Score: 1

      I never noticed it to be a time thing; I get the huge memory use when I have multiple tabs open, opening and closing of tabs (it's like something's not freeing memory when it should) and some multimedia type of stuff seems to take a huge bite out of memory without releasing it - leaving it up running while doing nothing doesn't eat up the memory.

    2. Re:not too bad by schnikies79 · · Score: 1

      435mb currently. One tab open to slashdot, on OS X, and no plugins installed. It's about the same (+/- 50mb) on Windows 7.

      It has been open for about 6 hours.

      --
      Gone!
    3. Re:not too bad by Idbar · · Score: 1

      It seems like certain pages will dramatically increase the memory consumption of Firefox. I've found that opening multiple pictures from facebook using multiple tasks can take easily 200MB (in addition to what Firefox was already consuming). The problem is of course that in the case of pages such as Hotmail, Yahoo, and sometimes Facebook itself, Firefox fails to re-claim and free that memory after closing the tabs.

      This will also happen in Gmail if you have many javascript features open. Chrome seems to make things better because each process is killed and the memory freed for each tab/window (it will still add up a lot if you add each process' memory), while Firefox chunk of memory just looks massive.

    4. 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.

    5. Re:not too bad by Anonymous Coward · · Score: 0

      I think it's OS-related. While FF continues to add memory no matter where I run it (I synchronize everything between Windoze and linux) I have noticed that it chews through memory a lot more quickly on Windoze. On linux at the moment I'm using 88MB and climbing slowly (probably around 1MB/hr) but on Windoze it will start up over 100MB and probably use around 5MB/hr. I'd be looking closely at the XUL and Flash libraries on Windoze to start.

    6. Re:not too bad by Randle_Revar · · Score: 1

      Some get time-based issues in FF, others don't.

      My uncle's FF gradually bloats, slows and dies if he doesn't recreate his profile or take similar measures every couple of months. Sure, his addon habits are not great, but they aren't that awful as far I can see. On the other hand, I might create a new profile every few years, and even then it is usually more for shits and giggles than real perf issues. Windows or Linux, doesn't matter.

    7. Re:not too bad by jo_ham · · Score: 1

      I already did - I used to use FF on OS X but dropped it like a rock with FF4. They stepped backwards, at least on the Mac with 4.

      However, I'm not much better off with Safari - with the Adblock extension it has a memory leak that causes it to gradually consume all available RAM after a couple of days being open. Quitting and reopening it works (closing all tabs does not). Chrome is ok (and I use both browsers side by side) and is slightly faster than Safari and doesn't chew up quite so much RAM - crucially I get it back when closing tabs, so I don't ever end up in a disk thrashing situation like I do in Safari when it's consuming 2.4GB of RAM with only one tab open.

    8. Re:not too bad by Anonymous Coward · · Score: 0

      I like to run with 50-100 tabs open, just the way I work and remember things. Have to restart FF4 on my OS X systems mulitiple times per day. Often I can watch in Activity Manager as the memory used by FF4 climbs 12MB per second until FF4 hangs.

    9. Re:not too bad by my+$anity++0 · · Score: 1

      Amen to that! I used to run 45-50 tabs, and now I'm running 8. Getting worse memory useage now.

    10. Re:not too bad by supersloshy · · Score: 1

      What add-ons are you using? One of those could be contributing to that rather high RAM usage.

      --
      "Our country is not nearly so overrun with the bigoted as it is overrun with the broadminded." -Archbishop Fulton Sheen
    11. Re:not too bad by Anonymous Coward · · Score: 0

      Ditto. 3.1.x, which I still have on my other machine, is rock stable with the same extension set. FF4 on OS X has issues. The latest thing I've noticed is some interaction with Kotoeri that causes memory usage to explode. The fix has been simple, though, I've been running Chrome ;_; I'll see if these issues are cleaned up in FF5, if not, then I won't be looking back. I would like NoScript on Chrome, but AdBlock/Ghostery provide at least basic sanitation.

    12. Re:not too bad by ischorr · · Score: 1

      Blaming add-ons for FF's memory leaks and failure to reclaim is like the "repair your disk permissions" or "update your drivers" of the browser world.

      It's sometimes add-ons. Very rarely.

    13. Re:not too bad by hackertourist · · Score: 1

      another OSX user:

      78 tabs, 1.33 Gb 'real memory' according to Activity monitor. According to about:memory:
      Memory mapped: 974,811,136
      Memory in use: 875,324,896
      after 1 day.
                 

    14. Re:not too bad by supersloshy · · Score: 1

      You can't eliminate the possibility that the problem might reside with a popular add-on or two. I'm not saying Firefox doesn't have a memory problem, but what many people see might be related to an add-on. I for one never have Firefox RAM levels nearly as high as that, as do many other people. Just because I don't see the problem, though, doesn't mean that it doesn't exist, but it's still important to provide WAY more information than "I went to some pages and my RAM went up". There are so many other variables missing from that so it makes the reporter sound like a troll when he might not mean to sound like one.

      --
      "Our country is not nearly so overrun with the bigoted as it is overrun with the broadminded." -Archbishop Fulton Sheen
    15. Re:not too bad by lucian1900 · · Score: 1

      My machine appears to be a pathological case. With no tabs, it's already using 400mb. If I open and close a few tabs, it very quickly grows until about 600mb.

  8. Dear Firefox leaders by Anonymous Coward · · Score: 0

    What took so long?

    This has been a big problem since at least 3.x.

    And can we talk about resource consumption in general?

    1. Re:Dear Firefox leaders by Anonymous Coward · · Score: 0

      Agreed. It's about a version too late, as I've already jumped ship. Although it's nice to hear that, despite years of people saying "Yanno, there's a memory problem with Firefox", it's actually being taken seriously.

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

    Bundle in MagnaRAM with Firefox.

    1. Re:Easy solution by Anonymous Coward · · Score: 0

      That article was written in 1995. I wonder how useful it will be to todays tech. Also that application is closed source. FF is OSS.

    2. Re:Easy solution by Anonymous Coward · · Score: 0

      Never mind that you have to pay that site to read the rest of the ad.

      lulz.

    3. Re:Easy solution by Anonymous Coward · · Score: 0

      Heard of a joke before? :)

    4. Re:Easy solution by waddgodd · · Score: 1

      When they make magnaram for Solaris/SPARC, let me know, until then, kindly keep your platform-dependent solutions to yourself.

      --
      Just because you're paranoid doesn't mean they aren't out to get you
    5. Re:Easy solution by Anonymous Coward · · Score: 0

      When they make magnaram for Solaris/SPARC, let me know, until then, kindly keep your platform-dependent solutions to yourself.

      I think you missed the joke (unless I missed the follow-on joke).

    6. Re:Easy solution by Anonymous Coward · · Score: 0

      whoosh.

    7. Re:Easy solution by narcc · · Score: 1

      When they make magnaram for Solaris/SPARC, let me know, until then, kindly keep your platform-dependent solutions to yourself.

      Hey, it's really a really useful post for those of us running Windows 3.1 -- just because it doesn't help you doesn't mean that it's not a helpful solution!

    8. Re:Easy solution by NJRoadfan · · Score: 1

      MagnaRAM was pretty worthless, it actually slowed down the machine during certain operations. Syncronys Software had a program called SoftRAM that testers found out basically did nothing too. http://www.technofileonline.com/texts/softram95.html

  10. Good! by gman003 · · Score: 1

    Firefox desperately needs to lower its memory usage. I've been using FF4 for a while now, and it's using 200MB. It's gotten so bad that I installed an addon to provide easy restarts - twice a day or so, I reboot the browser.

    Yes, 200MB would be fine if the computer was just being used for web browsing, or even just office stuff. But I use this machine for gaming a lot - a a recent convertee from Chrome, I'm used to being able to start up a massive memory-hog game without needing to close out my browser.

    1. Re:Good! by jawtheshark · · Score: 1

      You still can, if the OS has adequate memory management, your browser will be relegated to swap. After your game, the browser will be there and take a bit of time to load back into main memory, but it'll be quicker than a fresh start.

      --
      Ahhh...the great dumpster continuum. Many a free computer will be found there. -- sowth (748135)
    2. Re:Good! by sneakyimp · · Score: 1

      DDR3 Memory is DIRT CHEAP now. I'd strongly encourage you to buy more. If you are on a 32-bit OS, then upgrade!
      e.g.: http://www.newegg.com/Product/Product.aspx?Item=N82E16820231277

    3. Re:Good! by gman003 · · Score: 1

      Laptop. Only two slots (DDR2 as well), and both already have 2GB in them. Upgrading to 4GB sticks of the same speed would be $140. Since I'm planning to get a new machine this year, it's not worth it.

      And yes, modern games will easily use 4GB.

    4. Re:Good! by mdmkolbe · · Score: 1

      200MB?!! You must have only one tab open.

    5. Re:Good! by sneakyimp · · Score: 1

      I am truly sorry for your lots. It's kind of pricey to get more than 4GB in a laptop.

    6. Re:Good! by DarkXale · · Score: 1

      Most modern games don't even have LAA flags set, so no. The actual games themselves will generally sit between 800mb to slightly below 2gb.

    7. Re:Good! by gman003 · · Score: 1

      Actually, I don't think I've installed Flash on this browser yet. That might be the cause.

    8. Re:Good! by gman003 · · Score: 1

      Unless you're on 64-bit, in which case it can theoretically access terabytes of RAM, should you have that much.

    9. Re:Good! by Nemyst · · Score: 1

      Get more RAM. The usual game can only use 2GB of RAM since they're still 32-bit programs not using large address awareness. This means that with 4GB, a bare minimum these days for gamers, you still get 2GB for the OS and programs. That should be plentiful. If not, well memory is cheap.

      Seriously, there's no reason NOT to have a lot of RAM right now. It'll always come in handy.

    10. Re:Good! by frozentier · · Score: 1

      The problem is that FF will eat up the new RAM you put in, too. I don't personally mind it, though. That's why I still use Windows ME.

    11. Re:Good! by cyber-vandal · · Score: 1

      God I hate fanboys. Dirt cheap RAM is still not free and upgrading a Windows installation from 32 bit to 64 bit is neither cheap or convenient unless there's fuck all installed on it. Here's another suggestion. Firefox devs should fix the memory management issues that have been there since at least v2.0. And I'm typing this from FF4 which is currently sitting at 300MB with only 5 tabs open.

    12. Re:Good! by DarkXale · · Score: 1

      That still only holds true if the program itself is 64-bit; an exceedingly rare occurrence still amongst games, and I can think of no modern game with 64-bit capability. And as most - like I said - furthermore have no LAA flag set - the operating system does not allow them to access more than 2GB of RAM. If they attempt to use more, they will crash with an out of memory error; and for that reason the games are explicitly designed to use less than that at all times.

    13. Re:Good! by gman003 · · Score: 1
      Maybe five years ago, but many games have actual 64-bit versions now. Just to name a few games with native 64-bit:
      • Every Valve game (Half-Life 2, Team Fortress 2, Left 4 Dead, Portal)
      • Unreal Tournament (2004 and 3)
      • Far Cry, Crysis, and Crysis 2
    14. Re:Good! by DarkXale · · Score: 1

      While I've not tested Crysis 2 - how many of these exceed 2GB in used RAM? (The entire point of this debate)

    15. Re:Good! by tepples · · Score: 1

      how many of these exceed 2GB in used RAM?

      That depends on the disk caching capability of your operating system. If the game is installed to your hard disk, it can predict where the player is likely to go next, and then a background thread can open, read, hash, and close the map and texture files associated with that place.

    16. Re:Good! by tepples · · Score: 1

      If you are on a 32-bit OS, then upgrade!

      Unless you rely on some peripheral whose driver works only on a 32-bit OS, not on a 64-bit OS.

  11. Re:Memory problem? by dstar · · Score: 1

    That sounds about right, for the first week or so, if you only have 10 tabs open. Try 25-30 tabs, for a month, and it's much larger, especially if you've visted a few poorly-designed webpages. (Though to be fair, I find that poorly designed webpages have obvious markers, like one I recently timed at seventeen seconds(!) before I could scroll down... and if I leave it open in a tab, eventually crashes the browser (although that takes a couple of days)).

  12. Other annoyances by Savantissimo · · Score: 1

    If they could prevent a bad script or plugin from taking the whole browser with it, that would be great.
      It really needs a way to see a list of what scripts and plugins are running, what resources each is consuming and the ability to kill them individually.
    A list of currently open tabs would also be good, especially if it also had a history list for each tab (bonus points for making it editable, with drag and drop, etc.).

    --
    "Is life so dear, or peace so sweet, as to be purchased at the price of chains and slavery?" - Patrick Henry
    1. Re:Other annoyances by hedwards · · Score: 1

      This is a much bigger problem in my experience. I know that they are working on that, but it seems to be taking ages. I do appreciate the effort that's going into the tab isolation, but until they do that, this sort of problem is going to persist.

  13. OPEN SORES LINQUAFRANCA FOR "WE SUCK" !! by Anonymous Coward · · Score: 0

    You open sorers never will get memory !! It's just not in you !!

  14. Re:Memory problem? by hawguy · · Score: 1

    What memeory problem? It uses 150MB when just browsing with a few tabs open, I've stress tested mine with 10 tabs of videos, pages and flash. It never passes 250MB.
    Who even has that little RAM still, let alone uses firefox like that?

    My browser has been open for about 2 days, I have around 20 tabs open (no video sites, though I'm sure a lot of the pages have Flash ads)

    It's currently using 2200MB of virtual memory and 1100MB of real memory.

    That doesn't include the 289MB/123MB used by the Flash plugin container.

  15. Re:Memory problem? by the_raptor · · Score: 1

    10 tabs is kindergarten for serious browsers. The problem from what I can tell is with people who have A LOT of tabs open for a long time. Remember not everyone shuts down their computer each night, some people keep Firefox instances running for months.

    Also even if it only uses 250MB that is unacceptable if that is more then it actually needs to use. If everyone followed the "people have heaps of memory so don't worry about minor memory leaks" then we would quickly find our abundant memory filling up. Memory bloat and "just reboot" are never acceptable.

    --

    ========
    CINC, 4th Penguin Legion
  16. screw mozilla. by Anonymous Coward · · Score: 0

    Version 4 is the death of fireefox. I was a long time supporter and I switched to chrome when ver 4 came out. Performance is crap on a Core i5 laptop running Win 7.

  17. unlikely by waddgodd · · Score: 1

    They closed the memory leak bug with wontfix. NOW all of a sudden they care about memory? Yeah, I'll believe it when I see it.

    --
    Just because you're paranoid doesn't mean they aren't out to get you
    1. Re:unlikely by scdeimos · · Score: 1

      The memory leak bug? There was only one?

    2. Re:unlikely by surveyork · · Score: 1

      It's not the first time Mozilla does an about-face after ignoring multiple reports for years and/or closing the relevant bugs as wont'fix or WFM.

      --
      2019 is going to be the year of Linux on the desktop.
  18. Re:Memory problem? by Anonymous Coward · · Score: 0

    What find of maniac cunt has their desktop computer on for more than 2 days running, and if that is the case, is incapable of restarting their browser in under 10 seconds if some kind of freakish (since firefox 1 i've had no more than 300mbs of RAM usage) memory consumption issue occurs? Well, you screaming cunts? IIII'M WAAAAAAITINGGG...

  19. good news / bad news by roc97007 · · Score: 1

    The good news is, the team has produced a plugin that reduces the browser's memory footprint to 25 Mbytes.

    The bad news is, the plugin takes up 300 Mbytes.

    --
    Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
  20. What memory problem? by Anonymous Coward · · Score: 0

    In all seriousness, I have 3 computers, firefox 4 on all 3, and not one of them eats much memory with firefox, which is open basically all the time. This is curious to me as evidently a lot of people DO have a memory problem, and it makes me think the "problem" may not be the browser itself, but something related.

    3 Computers
    A. Pentium 4, Radeon9200 graphics(64 megs video mem), 512 megs ram, gentoo 2.6.38, no window manager (mythtv box), firefox launched via script to fullscreen mode
    B. Pentium 3, Mach64 graphics (radeon mobile, equivilant to a radeon 128 w/ 8 megs video mem, 512 megs ram, gentoo 2.6.38, XFCE4.6
    C. Core2, gf9800gt (1 gig video mem), 8 gigs ram, gentoo 2.6.38, XFCE4.8

    All 3 are set up with two plugins, noscript and adblock+, the mythtv box has an addon I wrote that rewrites youtube pages for html5 when only flash is supported on the video, and my core2 has bugmenot also. All 3 built with xulrunner, and gnome-mplayer plugin for video, no other addons. All 3 behave similarly, firefox, with multiple tabs open, rarely even hits 60-70 megs of RAM usage. While i would personally still consider this high, it's not the problem i hear others talking about their browsers having.

    This makes me think the memory problem lies in either plugins, or in a build setting that my copy of firefox is not using, if this is true, it seems like the "proper" thing to do would be to either fork the plugin to a seperate process (so buggy, memory hog plugins can have their own name associated with the memory bloat people see), or change the defaults the firefox binary distribution ships with.

    I'll reply to this once i get home with the build flags I use, but I'm curious if anyone else could reply with how their firefox is set up, binary distro, built with certain flags, running plugins, etc.... and whether or not they see the memory problem. I think it would be interesting to see and compare the difference between ones with memory problems, and ones without.

    1. Re:What memory problem? by Anonymous Coward · · Score: 0

      Mostly the moment you do anything Flash related it gets insanely big (even if you close those tabs). But the fact of the matter is, the stupid thing has memory leaked since 2.X and they don't care. Really without NoScript and AdBlock FF would have been irrelavant ages ago.

    2. Re:What memory problem? by WankersRevenge · · Score: 1

      I'm running the latest build of Firefox on my late 2008 macbook pro with 4 gigs of ram. Right now, the app is taking 800megs while utilizing 15% of my cpu. I'm running Snow Leopard with five tabs open. One is a 404. One is an xml view. One is xbox live with the silverlight disabled. One is Slashdot with the ajax turned off. And the final one is an image was I viewing. I have only a couple of extensions installed and I never open a lot of tabs. Five or six is my sweet spot. Once firefox exceeds 1 gig of ram it starts to peg my cpu to the point where I have to kill the process.

      Maybe it's the mac build, but it really is terrible. right now, I use it because of inertia but I these days, I feel more like a babysitter.

      It relieves me to see them finally taking this issue seriously but I wonder if it might be a little too late (in my case). I'm just sick and tired of being sick and tired with it.

      Btw, it's now up to 865mb from when I started typing. Just switching tabs kicked it up to 890 and now 920. I'm not making this up. I've seen the same behavior on vanilla installs. It's hard to believe it's persisted so long. Lets hope we see from fruit from there team. 950 now. I can't access the status bar. Submitting this then closing down the process.

      PS - Post preview it dropped to 730 although I still can't access the status bar.

  21. Not as bad as Opera by cruachan · · Score: 1

    Firefox uses massive amounts of memory, but it's not as bad as Opera which I'm starting to suspect has a serious memory leak. On my system at the moment - Window 7 ultimate 64 bit with 6Gb memory, Firefox is using 336Mb, but Opera, with less pages open, is up to 445Mb and it's using 4% CPU in the background too. I used to use Opera a lot, but increasingly I'm relegating it because of this issue.

    OTOH Chrome seems to be becoming increasingly frugal over how much it uses.

    1. Re:Not as bad as Opera by ischorr · · Score: 1

      This is, really, the only reason I don't use Firefox. And I keep trying to go back, probably every month for the last year and a half.

      I do use a lot of tabs, but over time the memory usage grows to well over 1GB (sometimes 2 or even 3GB), and the memory is never released, even after closing all tabs. This has been a problem for me since at least FF 3.0, on several systems, each with its own unrelated profile. On both Mac and Windows. I don't think I navigate to particularly unusual sites.

      I use no add-ons, at least on most systems.

      The response to this problem is usually exactly the comments we see in this story, which are generally:

      1) Memory leaks are due to bugs in add-ons. Disable all your add-ons one at a time until the problem goes away.
      2) I don't have this problem; something must be wrong with you.
      3) Just buy more RAM. It's cheap.

      I don't understand why people are so aggressively against investigating these problems. Even with a task force announced to address the problems, a huge # of people in this comment stream are still calling foul.

      I'm not sure if Chrome uses less memory, but at least when I close a tab, the memory is released. All of it. Immediately. I don't have to restart the browser to get it back.

    2. Re:Not as bad as Opera by Barny · · Score: 1

      3GB? Really? There is a limit for how much memory a 32bit application can address, 3GB being it (if running on 64bit system with extended memory support set in the executable, otherwise its 2GB) so I doubt you would ever see it reach that number as the client would crash due to memory allocation error right about then.

      I have never seen FireFox break the 500M mark myself, I keep my browser running for months on end (only shut down for hardware upgrades) and open 50+ tabs at least twice daily.

      Not that I care, it could use 4GB of ram for all I care, its the features I crave, noscript being the primary, I have room for it to grow and don't care unless it tops out the 12GB of ram in my box :)

      --
      ...
      /me sighs
    3. Re:Not as bad as Opera by julesh · · Score: 1

      There is a limit for how much memory a 32bit application can address, 3GB being it (if running on 64bit system with extended memory support set in the executable, otherwise its 2GB)

      Most 32-bit systems are more than capatable of providing 3GB of application address space. Under Windows, you'll need the /3GT kernel command line option. Under Linux, it should just work.

    4. Re:Not as bad as Opera by Barny · · Score: 1

      Actually, you don't need that line any more, 64bit assumes that, but you do need the 3GB address bit flipped in the executable, not 100% if Firefox has it (would be stupid not to) but I am guessing so, still if the parent is seeing an app hit 3GB of memory used, it will die right there and then, that is the upper limit for ram usage (not that I have ever seen Firefox break the 1.1GB barrier, even after four months of constant usage).

      --
      ...
      /me sighs
    5. Re:Not as bad as Opera by ischorr · · Score: 1

      You just reinforced my core point.

  22. BLAME FLASH by Anonymous Coward · · Score: 0

    My firefox is fine until I start using flash, and then it runs away like a bloated pig.

  23. 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.

  24. 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 Rufty · · Score: 1

      Don't forget the 10 minute battery life and knee-searing temperature if you tried to use Firefox on a laptop. Went to Chrome and won't be going back.

      --
      Red to red, black to black. Switch it on, but stand well back.
    3. 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."
    4. Re:Yay by ischorr · · Score: 1

      My thoughts exactly.

    5. Re:Yay by Anonymous Coward · · Score: 1

      Typical head-up-own-arse Mozilla devs. I remember in the past them claiming there wasn't a problem with their browser for causing my Windows 2000 to BSOD. Repeatedly they told me over the course of a couple of years that it couldn't be the application and that it must be my OS at fault. It turns out they had bug that wasn't releasing bitmap handles. No wonder I would get weird Win95 style running-low-on-resources graphical artefacts shortly before a BSOD in nv_disp.dll. Some of these issues are f***king basic programming mistakes, if they would just listen to people. My experiences with these pricks over the course of several years almost a decade ago was enough to put me off getting involved in the projects. It seems nothing has changed.

      I hate prima donna developer types. Developers aren't typical users, so what makes most of them think they can understand and resolve typical users problems?

    6. Re:Yay by Anonymous Coward · · Score: 0

      Wow, you bitched 5 years about it?
      Nice contribution to the open source community! Thank you for your 5 years worth of venom towards the developers of a completely free product.

    7. Re:Yay by Waccoon · · Score: 1

      Now it will only take another 5 years before other Firefox users stop blaming me for my addons or profile.

      I haven't seen such denial from a user base since the MacOS extension days.

    8. Re:Yay by Shin-LaC · · Score: 1

      It always seemed to me that Chrome uses even more memory than Firefox.

    9. Re:Yay by alexo · · Score: 1

      I've been using FF since version 2 and there are two problems that persist (and apparently gather no interest from the devs)

      1. Every n seconds (n varies), FF CPU usage spikes up, even if it's idle.
      It makes it impossible to e.g. watch youtube in FF or in any other browser if FF is concurrently open.
      See https://bugzilla.mozilla.org/show_bug.cgi?id=490122 (open over 2 years ago, not worked on).

      2. FF's memory usage grows until it reaches ~1.5GB, then it hangs forever with 100% CPU usage.
      The easiest way for me to trigger this behaviour is to go to Google Images, set the image size to "Larger than" 1024x768 (or even higher) and start checking various search terms, scrolling down, hovering on thumbnails and making sure to use "show more results".

      I still use FF because some of my favourite addons are FF-only, but the majority of the time I use other browsers.

  25. How to allocate more RAM to firefox? by sneakyimp · · Score: 1

    I noticed this problem with Firefox and bought tons of RAM for both my Windows 7 64-bit and my Ubuntu-64 machines. Weirdly, they don't take full advantage of the extra RAM and I still get sluggishness as these programs appear to be paging to disk. I therefore welcome this advancement.

    PS: If anyone has tips about how to get more memory to FF, I would greatly appreciate it.

    1. Re:How to allocate more RAM to firefox? by Anonymous Coward · · Score: 0

      Use a 64-bit builds of Firefox. Even Flash works, it has a 64-bit version these days for Windows 7. I don't know if it's up to date, though. http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/

    2. Re:How to allocate more RAM to firefox? by cbhacking · · Score: 1

      Are you hitting the 2GB limit? A 32-bit program will typically only allocate up to 2GB at a time, since that's all it can map in userspace. (It can allocate more, and change the mapping window, but not many programs do that). A 64-bit program has (by the standards of modern PCs) an infinite space to map memory into. There are 64-bit versions of Firefox, but you have to go find them; the default, especially on Windows, is 32-bit even with a 64-bit OS.

      One simple way to increase the prioritization of the process. Task Manager -> Processes -> Right Click -> Priority. Bump it slightly ("Above Normal") so it gets more priority than other stuff, but less than critical things (which run at "High") and Windows should be less likely to page out its memory.

      Just be glad you're not using XP, which tends to assume your computer has about 256 MB of RAM and will page out aggressively as soon as you switch to another program, even if the other one is still running and you're about to switch back.

      --
      There's no place I could be, since I've found Serenity...
    3. Re:How to allocate more RAM to firefox? by sneakyimp · · Score: 1

      Cheers. Good info. Thank you.

    4. Re:How to allocate more RAM to firefox? by jvonk · · Score: 1

      Not trying to troll, but if you have tons of memory and are pained by Firefox's/MacOS' insane paging-for-no-reason like I was, then why not disable swap?

      That's what I did. It made my Mac responsive again while using Firefox. I found the frequent 20+ second freezes while paging in to be infuriating, given that the machine has 6 GB physical.

      No freezes anymore, but MacOS is not designed to run without swap and Fails Badly if you run out of memory. You have to "pull the plug" (ACPI initiated poweroff) because not even the mouse will respond.

      PS. nothing beats the pain of using the New Slashdot in an Android browser. Ugh. I apologize in advance for any errors caused by the site fighting to control my cursor and have it jump around for the lulz while I type this.

    5. Re:How to allocate more RAM to firefox? by jvonk · · Score: 1

      Also, I realized full well that the comment I was replying to only referenced Win7/Ubuntu, but I glossed over that because its trivial to disable swap for Windows/Linux and they lack the egregious side effects of OOM/memory pressure that MacOS X 10.6 64-bit (at least) has if swap is disabled.

    6. Re:How to allocate more RAM to firefox? by Anonymous Coward · · Score: 0

      Go to about:config in Firefox and filter for browser.cache - there you should find the settings you are looking for.

  26. 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.

    1. Re:Pinpoint by Nick+Nethercote · · Score: 0

      This is a known problem, due to some changes in FF4 regarding the discarding of decompressed images. See https://bugzilla.mozilla.org/show_bug.cgi?id=660577

    2. Re:Pinpoint by surveyork · · Score: 1

      Bug 660577 - Image-heavy sites are slow and often abort due to OOM; regression from 3.6 https://bugzilla.mozilla.org/show_bug.cgi?id=660577 Bug 661304 - Not discarding images that are not visible on the current tab causes a memory usage problem https://bugzilla.mozilla.org/show_bug.cgi?id=661304

      --
      2019 is going to be the year of Linux on the desktop.
  27. 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 Anonymous Coward · · Score: 1

      > 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

      Yes, but the amount FF uses actually IS bad. On my 2 GB netbook, running nothing but FF and KDE, the system goes into heavy swapping if I let FF run for a week or so without restarting it. That doesn't happen with rekonq, for example. FF's process is *always* the single biggest user of memory on the system, and just moving to a different tab can cause 10+ seconds of swapping.

      Something is broken, and I'm glad they are looking into it - kudos to the FF devs, I say.

    2. Re:Problem of perception? by TaoPhoenix · · Score: 1

      Naw, efficient programming is the hallmark of good code.

      Here, my machine seems to take a long time to recover "Firefox is in use" after you close an instance. That's annoying.

      --
      My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
    3. 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)

    4. Re:Problem of perception? by parlancex · · Score: 1

      Yes, that's basically what I said. The problem isn't that Firefox can use a lot of RAM, but rather it isn't paying attention to the amount of RAM available to the system and acting accordingly. On all platforms you're going to have the ability to check the amount of memory actually available to the entire system, as this amount decreases Firefox can begin to proactively free memory used for the oldest cached data.

    5. 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.

    6. Re:Problem of perception? by parlancex · · Score: 1

      First off, for better or for worse there's no way for an OS to actually free an allocation used by an application in either Linux or Windows. There is no mechanism in either the page or heap allocation APIs in either operating system to declare an allocation in such a way as to let the OS know that instead of paging this memory to disk when low on memory, it should instead just free it and let the application know it has done so. It's a good idea, but it doesn't exist. Secondly, the OS really doesn't have any intelligent insight into the usefulness of a particular allocation to an application. An application will always be more aware of what cached data is more useful than others.

      For both of these reasons, when speaking specifically of CACHED data that can be freed with impunity, the OS both cannot and should not assume that role. I'm not saying every application should implement this kind of logic, but for certain applications it is certainly worth it.

    7. Re:Problem of perception? by Anonymous Coward · · Score: 0

      Why not allow the user to set some behaviour patterns (I haven't explored all of about:config yet - perhaps there's something in there I should look at?), such as in the circumstances you describe? I think one should be able to tell the OS to give memory priority to certain applications, or at least set a minimum level of RAM.

    8. Re:Problem of perception? by Randle_Revar · · Score: 1

      And of course both IE8/9 and Chrome take rather more RAM than FF...

    9. Re:Problem of perception? by Anonymous Coward · · Score: 0

      When I start to notice my machine shutter and I open the task manager to find firefox chewing on over 2gb worth of my ram while running nothing more than a slashdot page and facebook, I question it and feel such a thing shouldn't happen.

    10. 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.

    11. Re:Problem of perception? by 10101001+10101001 · · Score: 1

      I entirely agree. This all does sound like something that should be worked into the OS in a more generic fashion. Certainly, there's lots of programs that strive to be clever when it comes to caching one thing or another, be it textures for models, web pages, etc. The only thing I can think of that might work generically is a combination of mmap to allocate a memory area as transient and removable at will by the OS and a means to mark a mmap area as non-transient when its used then transient again when done.

      That still requires some work on the application side, but it removes a lot of the guess work of what should be removed. Unfortunately, it also still leaves the burden on what to add or how much to attempt to add to this transient memory pool. I don't see a real way around this since in many ways virtual memory and swap space were designed primarily to try to magically solve those dilemmas by just allowing programs to allocate as much as they want. And obviously, that just leads to heavy swapping at time which is brutally inefficient. :/ At some level, it'd seem like the most effective approach would require giving the OS the opportunity to call back into applications to tell it when to fill its OS granted cache space and further when it was going to lose some of that cache. Effectively, that'd be a per-app balloon driver.

      Of course, with something like Firefox, it'd seem a better approach anyways would be multiple processes (to avoid internal fragmentation and allow for cleaning dangling handles given how buggy web browser are) and a centralized cache manager much like Chrome.

      --
      Eurohacker European paranoia, gun rights, and h
    12. Re:Problem of perception? by hairyfeet · · Score: 1

      Uhhh...noooo...if you are using a percentage of unused RAM that is ONE thing, having your program suck up RAM like a Bangkok whore and then mercilessly beat the page file like a pimp that hasn't gotten his money is quite another, thanks ever so.

      I'm typing this on a 1.8GHz Sempron with 1.5Gb of RAM that I use as a nettop. This is roughly equal to what the average netbook is, actually it has 500Mb more RAM that most current netbooks, and what I have found is that while Chromium based like Comodo Dragon make this machine a nice pleasant way to do basic web surfing, YouTube, checking email, etc FF 4 is completely fucking unusable because of the way it bitchslaps the CPU and pounds the living shit out of the RAM.

      Let me give an example: If say I am checking my email and a friend sends me a link to a Youtube video in Dragon I can click on that link and while the CPU will spike to say 80% for a few seconds in dragon it quickly drops down to a more reasonable level and most importantly never loses responsiveness so if I decide I don't want to watch said video or want to launch another tab? No problemo says Dragon. Now with FF4, which frankly FF 3 up to the 3.5 branch didn't have any problem with either, just launching a video tab can spike the CPU for up to two minutes where the machine isn't responding to shit. Also when I close a tab in Dragon I can actually look at Anvir task manager running in the taskbar and watch memory usage go down. FF 4? nope you better close that browser if you want any of the gobs of memory we are sucking up buddy! Also I've noticed while Dragon takes up around 150-200Mb on initialization after that it is pretty conservative which each page taking between 50-80Mb whereas FF 4 can quickly suck up over 1Gb of RAM and that bitch ain't giving it back, no sir no how! And it isn't the extensions since I use the exact same two in both, Adblock Plus and ForecastFox and that's it.

      So in conclusion while FF 2 had some severe memory leaks there for awhile in FF 3 things seemed to be getting better. The pre 3.5 branch actually didn't constantly slam the CPU and memory, was generally responsive, and one could use it most of the day without watching the page file get an ass kicking. Since the switch to FF 4, now with extra bling, the thing is frankly unusable on anything less than a 3GHz P4 with a couple Gb of RAM and frankly that is inexcusable. This is a fricking browser we are talking about here, not the latest PhotoShop. Considering not only that there is something like 400 MILLION XP machines out there with specs similar to what I've described or even less, but also netbooks and nettops currently being sold with similar or less, having a browser that sucks resources like a fat guy at the all you can eat buffet just isn't acceptable.

      I've have always used FF since the old days but now for me and my customers I'm handing out Comodo Dragon. I have to support everything from P4s and Netbook/tops to the latest and greatest and having whole classes of machines that can't do anything but stutter thanks to FF 4 makes it simply unusable for purpose. Personally I hope they fix this, along with supporting low rights mode for modern OSes (really FF devs the feature has only been out now for 5 years and now 2 versions of the OS, time to get on the ball) because I did like the extension framework and some of the GUI elements on FF better than I do the Chromium based. But having a better framework and GUI really doesn't help if you need to go make a sandwich while a page loads thanks to the CPU and RAM beatdown the machines gets.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    13. 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.

    14. Re:Problem of perception? by perryizgr8 · · Score: 1

      i don't have a problem with firefox eating up all my memory. but what i do have a problem with is that after 2-3 days, firefox starts eating up 20-30% cpu! even if i close all of my tabs and look at a blank tab, the cpu usage is continuous. then i have no option but to restart firefox. battery life is affected, the computer runs hotter, etc. and the best thing? this was not a problem in any of the previous versions.

      --
      Wealth is the gift that keeps on giving.
    15. Re:Problem of perception? by Anonymous Coward · · Score: 0

      The more proof that using more memory is bad. Think of all the other programs and how on top of requiring much less, they don't have this sort of issue at all. So while they assume we're all blessed with RAM by the terabyte when the reality is that desktops are going down, and underRAM'd portables and tablets are inching to be the norm, people will start hurting for more efficiency in their tiny little 1GB Windows netbooks.

    16. 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."
    17. Re:Problem of perception? by bill_mcgonigle · · Score: 1

      Would Soft references be a better comparison?

      So, how would this work? I think three syscalls would be needed:

      1) store the data and return a handle
      2) return the data given a handle (with a cache miss return code)
      3) free the data given the handle

      and maybe:

      4) see if the data is valid given the handle (without returning)

      but some of these seem hard to do atomically and usefully, I'm probably just not thinking it through.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    18. 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.

    19. Re:Problem of perception? by MichaelSmith · · Score: 1

      I wonder if using different processes for each tab would help by releasing memory to the OS whenever a tab is closed?

    20. Re:Problem of perception? by johncandale · · Score: 1

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

    21. Re:Problem of perception? by pclminion · · Score: 1

      The solution is discardable memory, a feature that actually existed in Windows 3 (and perhaps before -- don't know for sure). You make a call to allocate memory. Instead of getting a pointer back, you get a handle. You'd lock the handle to get a real pointer, read/write the data as you please, then unlock the chunk. Discardable memory could be thrown away to the bit bucket at any time by the OS. If that occurred, the next time you tried to lock the handle you'd get an error indicating the block had been discarded. Sounds useless for data that has to stick around, but incredibly useful for caching things where if you lose the cached data you can just regenerate it or retrieve it again.

      These days, we call such things "weak pointers." Simple, effective.

    22. 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
    23. 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!

    24. Re:Problem of perception? by QuoteMstr · · Score: 1

      Of course it's better to touch fewer bytes and to keep the bytes you do touch as close together as possible. Virtual memory doesn't magically make these things happen for you. What it does do is make decisions about what makes to keep in RAM based on access patterns for the whole system, something no individual program can do on its own. In other words, it's exactly what the OP asked for!

    25. Re:Problem of perception? by arth1 · · Score: 1

      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.

      Well, that depends on the OS.
      Calling mlock() can indeed prevent memory from being paged out. Or using mmap() with MAP_LOCKED as a flag.
      Other operating systems have their own ways of preventing paging, but these should not be used willy nilly. There are plenty of good reasons to leave this to the kernel, and almost exclusively bad reasons for preventing paging. That your app could take a performance hit is always a bad reason.

      Anyhow, back on topic - yes, used memory is good memory, but only if it's used fairly. A single program that hogs memory to increase its own responsiveness does this at the expanse of others. If that program used less memory, that memory wouldn't stay idle, but be used for caching by the kernel. Some of which would benefit the app in question, and some that would benefit other apps and the OS itself. Grabbing all the memory you can is selfish, and downright detrimental on multitasking and multiuser systems. And if you only run one app, why, then the OS caching would almost exclusively benefit that app too. It's only when you can steal that memory from other apps that you get a real gain.

    26. Re:Problem of perception? by QuoteMstr · · Score: 1

      let the OS know that instead of paging this memory to disk when low on memory, it should instead just free it and let the application know it has done so

      madvise with MADV_DONTNEED or equivalently, or VirtualAlloc with MEM_RESET under Windows. Discardable memory isn't as useful as you think though.

      the OS really doesn't have any intelligent insight into the usefulness of a particular allocation to an application

      But applications can tell the OS what pages are important. On Unix, applications can use posix_fadvise and madvise. On NT. each page has a priority attached to it, and pages with lower priority are evicted only after those with higher priority are gone.

    27. Re:Problem of perception? by adri · · Score: 1

      Except if memory is managed quite a bit better, and you make higher up decisions about what you need and don't need (eg by keeping stuff truely on disk until you need it, and tossing it when you don't), then you can reduce your overall memory use and thus change how "worse case" your worst case behaviour is.

      For example, if I implemented a disk based memory cache tree, that leveraged the VM to cache stuff rather than an in-memory only database which leveraging the VM for "paging out stuff to swapspace", I can pick and choose how I handle locking that data structure. I can ensure that when accessed concurrently, the best and worse case behaviours are known. I can design that my API allows synchronous and asynchronous access where appropriate, and that consumers of said API know that synchronous access is that - synchronous - and program execution is going to stop in that thread until it's done. If that's unacceptable, they use the async method, and get a callback/message/etc when complete. Suddenly my performance worst-case is less than if the OS has swapped out part of my large in-memory database of "stuff", because who knows what the heck those threads have locked or their access patterns.

      What's the worst case? How can I express that in some kind of model? If things start going to hell in a handbasket, does it cause further paging IO? How much paging IO is tolerable before the application slows down? What threads are affected if a particular thing starts paging? What threads does that effect? Is the system naturally recoverable (eg, if threads start to page, less work gets done but it doesn't negatively affect the entire application), or does that cause work-queues to back up, which cause more threads to be spawned, adding more memory pressure. (Threads have stacks too, and you may find every new thread you're spawning to handle some asynchronous task because things are taking too long takes up 1 or more megabytes of RAM.)

      The OS can see what's going on, but it can't magically make an application behave better when it's in the situation of memory paging IO causing things to spiral -downward-.

    28. Re:Problem of perception? by Anonymous Coward · · Score: 0

      malloc() does not work this way, the comment you are responding to is correct.

      The problem with your description is that when an application uses memory in this way the values will be preserved regardless of what happens. If your information is evicted from RAM, it is written to disk, then read back in when it is referenced. This is a time consuming process which slows down both your application, and the one that needs to wait for the contents of your memory to be swapped to disk.

      For information that may or may not be used again, this will substantially reduce the performance of your application and the rest of the system if the computer runs out of real memory.

      When the operating system evicts something from the cache it does not write it to the paging file, it simply reassigns (and zeroes) the physical memory page (in the case of a file system cache, there is no need to write it back to disk, but it still needs to be loaded if it is used again.)

      On windows you can use CreateMemoryResourceNotification() to be alerted when the computer is running low on real memory, then free pages that you do not really need. Using this event well may be non-trivial depending upon how memory management works in your application, and it is usually easier to just reduce the memory usage of the application.

    29. Re:Problem of perception? by QuoteMstr · · Score: 1

      Calling mlock() can indeed prevent memory from being paged out

      And that's why it's a privileged operation. Yes, there are exceptions to the general theme, but real-world systems are always more complex than one would suppose from a distance. The presence of mlock doesn't change my overall point though: the operating system decides what gets to stay resident.

      A single program that hogs memory

      You don't get it. The operating system arbitrates between applications and decides whose memory is actually in physical RAM. It makes these decisions based on access-pattern information unavailable to normal applications. Yes, all things being equal, accessing less memory is better. But imagining applications as being "selfish" and as "hogging" memory is using a very naive mental model to deal with a very complex real world system. In general, that doesn't go very well.

    30. Re:Problem of perception? by Darinbob · · Score: 1

      Which is true if the browser is the only thing running. But often it is not. You have to share limited RAM with many applications. Most applications and operating systems just aren't able to communicate between themselves what memory can be freed and what should be kept around, and there's no API to say "cache or free this chunk depending on system usage". So the OS dutifully shoves the least recently used memory into swap space as ordered.

    31. Re:Problem of perception? by QuoteMstr · · Score: 1

      What's the worst case?

      Look: you can always give up efficiency to gain predictability. That's how real-time operating systems work. If you need hard bounds on access time, you can turn off the pagefile (or lock your application into memory). But the price is much less efficient use of RAM --- when you disable paging, the OS is forced to keep useless junk in memory, making less available for useful things.

      In the real world, we don't need hard realtime guarantees in the vast majority of situations. In the real world, paging is the right thing to do because it's a huge efficiency win, and because the OS makes the right page replacement decisions most of the time.

      But sure, if you're writing robot control software and people will die if the velocity control routine needs to be paged in, fine. Turn off paging. Or better yet, use a realtime OS like QNX. But for the rest of us, letting the OS manage access patterns is the right thing to do because the OS knows more than your application possibly can.

      handle some asynchronous task because things are taking too long takes up 1 or more megabytes of RAM

      You're still working with a naive mental model of how memory works. Thread stacks don't "take up" memory when they're created. Memory is not real estate. Thread stacks take up no memory until they're used.

      Yes, the kernel will set aside pagefile space to make sure it can satisfy requests for memory (unless you're using Linux and you use overcommit) --- but that's not the same as actually keeping all that memory resident.

    32. Re:Problem of perception? by Nick+Nethercote · · Score: 1
      The real problem is page faults. People don't notice how much memory a program uses until/unless it starts causing page faults. Some other observations and responses to this thread.
      • One reason that browsers are using more memory over time is that browers are way more capable than they used to be. HTML5, web apps and all that.

      • People say "I have N tabs open, Firefox is using M MB of memory". Often followed by "that seems outrageous" or "that seems reasonable". Without saying what those tabs have in them, it's pretty much useless.

      • Firefox's memory usage has varied over the years. FF2 was terrible, and contributed heavily to the bad reputation. FF3, FF3.5 and FF3.6 were much better. FF4 is worse than FF3.6; FF5 will be better (it already is). Subsequent Firefoxes will hopefully be better again.

    33. Re:Problem of perception? by QuoteMstr · · Score: 1

      CreateMemoryResourceNotification is precisely the wrong thing for reasons the GP has already described. It fails the "what if every application did this?" test.

      The right solution is better support for discardable memory. But that's a "nice to have", not a "must have" feature.

    34. Re:Problem of perception? by Anonymous Coward · · Score: 0

      You're hired! :) If I wasn't such an anonymous coward, I'd mod you up, no doubt about it :).

      The phenomenon of judging application quality based on such silly counters drives me nuts. I've worked on projects where we had to jump through all sorts of hoops to keep the more "obvious" counters (bytes/private bytes used) artificially low at the expense of taking more hard faults, ultimately REDUCING overall application performance. But hey, it keeps reviews positive...

    35. 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").

    36. Re:Problem of perception? by complete+loony · · Score: 1

      But still, there's heaps an application can do to reduce the number of memory pages that need to be read into ram at any point in time. If an application runs some kind of tree search, and each element it considers is on a separate memory page, then that will result in a lot more memory pages being read from disk. If, on the other hand, you optimise algorithms such that related data is located on the same memory pages, the number of hard faults can be drastically reduced.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    37. Re:Problem of perception? by nospam007 · · Score: 1

      Welcome oldtimer.
      Being an old fart myself, but none of the teens I have contact with closes any steenking tabs.
      Even when they close and reopen FF, the crap stays open.
      Off the top of my head I wouldn't know how to do that since the very idea is abhorring to me.
      I suspect they have no idea how to close a tab or they chose not to.
      Perhaps they are feeling that tabs are 'friends' and need to stay open to see what new, exciting stuff happens in the private life of a tab.

    38. Re:Problem of perception? by cratermoon · · Score: 1

      I'm typing this on a 1.8GHz Sempron with 1.5Gb of RAM that I use as a nettop

      Ignore the rest of your comment, I'll point out that, for better or worse, Firefox has for a long time been pushed for more features/faster rendering/snappier user experience and they've made what is the standard trade-off in programming: used more RAM. Firefox is now at the point where users with 4GB or more who don't really fret at a program using 700MB are happy at the responsiveness.

      Is that the right tradeoff though? Is it right to target the higher end systems and ignore the 1-2GB single core CPUs 2Ghz?

      For a while, it made sense to push the high end performance, but now there's been some rethinking. The majority of users seem to have discovered that for *most* of what they do, 2GB and 2Ghz is fine. Firefox is losing in that arena, and now some folks want to address that.

      Changing the mindset of the FF team is the most important aspect of this project, but also the most difficult.

    39. Re:Problem of perception? by Anonymous Coward · · Score: 1

      Discardable memory does not exist in a way applications can use. It might be a better solution if it did, but it simply does not exist right now. The operating system can do this internally, but you cannot do so in an application (or request that it happen.)

      Windows has never supported this, the GMEM_DISCARDABLE flag to GlobalAlloc() really means that the memory can be paged to disk, not that it can actually be discarded. In any case this flag has been ignored since windows became 32-bit (you instead specify that memory cannot be paged to disk if you need to.)

      CreateMemoryResourceNotification() is what you have to work with, as this provides an operating system notification that it is running low.

      It can be used successfully in low memory situations provided you can quickly free a lot of memory without accessing the pages that are candidates to be discarded (as they may already be paged out, and you do not want to force them to be paged back in, which would make the situation worse.) This is what makes it a hard event for many applications. You also already need to be using page based allocations, if you are using malloc() you will not be able to respond to this message appropriately.

      If a lot of applications responded to this message it would hopefully free a substantial amount of memory immediately without causing swapping. Even if it is not ideal, the alternatives are worse.

      If this event occurs a problem is already imminent, it merely provides you an opportunity to do something about it if you can. Losing your cache is generally less of an impact than having it swapped to disk (if not, it is not really a cache anyway.)

      Your options are:
      1) Do not use a large cache
      2) Use one, and let performance suffer if you run out of physical memory.
      3) Use one, and discard it if the operating system notifies you that it will need memory shortly.

      If you simply allocate a bunch of memory with malloc() and let the operating system sort it out, you are choosing the second option. It WILL preserve the contents of this memory, even if that means writing it to disk (which is specifically what you want to avoid by keeping your cache in memory.)

    40. Re:Problem of perception? by iiiears · · Score: 1

      In our day browsers never used much RAM Cus' they crashed. That purple ape couldn't save you either. and no one upgraded. Each download was paid for by check sent snail mail and the serial returned the same way. LOL! and we liked it. Checks were was written for each upgrade and we got bragging rights for using the latest version. Plugons were things like trumpet winsock and free browsers wouldn't animate gifs. Our friends on geocities missed us but we dialed in at 28k uphill both ways..........

      --
      15TW = 15,000 Nuclear Reactors. (Approx. one accident a month.)
    41. Re:Problem of perception? by The+Dawn+Of+Time · · Score: 1

      People are browsing from the server? Your problem isn't Firefox....

    42. Re:Problem of perception? by The+Dawn+Of+Time · · Score: 1

      Who said each application? A browser has fairly unique needs and usage patterns.

    43. Re:Problem of perception? by MichaelSmith · · Score: 1

      Welcome oldtimer.

      Me, old? (pushes a vertebrae back into position, ah thats better).

    44. Re:Problem of perception? by Anonymous Coward · · Score: 0

      I disagree that there is nothing applications can do to tune their memory usage. What you say is true if applications are using read-only data out of files, and memory mapping is a good way to play nicely in potentially low memory situations. In cases where the cache consists of in-memory objects that don't have an on-disk representation yet, though, just overcommitting memory with malloc() and letting the memory manager deal with it will result in extra I/O traffic for writing out those pages to disk that could have been avoided by simply discarding the objects and keeping memory usage lower. This is particularly disastrous for a garbage collected heap, where suddenly a GC collection can result in a huge number of pages having to be swapped back in in a hurry.

    45. Re:Problem of perception? by spongman · · Score: 1

      that's all well and good (caching, etc...), but perception is everything when you program crashes with an out-of-memory exception.

    46. Re:Problem of perception? by Anonymous Coward · · Score: 0

      Superfetch has gotten much better since Vista. So much so that I don't deactivate it on fresh Win7SP1 installs any more... I haven't noticed an actual speed boost, tbh, but it isn't a slowdown any more.

    47. Re:Problem of perception? by mdragan · · Score: 1
      I don't think that using RAM is bad, but I do think having a chunk free is good, because it means you can use more if you need it.
      I think you are besides the point here: nobody was talking about unloading data from memory to disk, as a solution. The problem is allocated memory by a program that looses control over that memory, and keeps it allocated even though it's not needed. There's also the problem of using memory efficiently, like only using two buckets to measure your water (http://www.folj.com/puzzles/easy.htm). Some people just throw in more buckets and that mindset can cause ugly memory problems.

      Now, when you're running out of RAM there is a problem, [...] applications should begin to free data

      You say that like there was a magic switch in all applications that did this. There is now such thing. I don't know if there is any application that does it, but I'm sure most do not. All the applications I've seen consuming large amounts of RAM keep doing so even when the free amount gets low. And that is because those large amounts of memory are used with things that the application can't free (because they lost control over them, or because the ARE using them in their inefficient way).

    48. Re:Problem of perception? by Anonymous Coward · · Score: 0

      +10 Informative

      And from a user / sysadmin point of view I agree with you.

      From a developer point of view, they should fine-tune what's in memory. With regards to working-set and locality of reference. Programs that are seen as memory hogs often keep little bits of data that are used frequency in between larger chunks of data that are rarely accessed. Even if only a few bytes are being accessed, the whole page has to be kept in memory. If developers don't keep in mind how memory is allocated at runtime, it's easy to make data structures that behave this way.

    49. 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.

    50. Re:Problem of perception? by julesh · · Score: 1

      First off, for better or for worse there's no way for an OS to actually free an allocation used by an application in either Linux or Windows. There is no mechanism in either the page or heap allocation APIs in either operating system to declare an allocation in such a way as to let the OS know that instead of paging this memory to disk when low on memory, it should instead just free it and let the application know it has done so.

      Good point. Except that there is. GlobalAlloc(size, GMEM_DISCARDABLE) on Windows is a published API for providing just such a declaration to the OS. It happens that all 32-bit versions of Windows ignore the flag, but it is still part of the public API, and as it was extremely useful under Win16 I have often wondered why MS removed it.

    51. Re:Problem of perception? by maxwell+demon · · Score: 1

      Unfortunately it only works well if all your windows are on the same desktop, which seldom is the case for me. In other words, after a Firefox restart I have to move every window back to where it belongs.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    52. Re:Problem of perception? by Reez · · Score: 1

      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.

      Try FF3 or 4 on a computer like I have at work (Windows XP, 2GB) and you will surely change your it-works-for-me-you-ignorant mindset. With FF you are *always* running out of RAM. If only there were *good* NoScript and AdBlock clones elsewhere ...

    53. Re:Problem of perception? by maxwell+demon · · Score: 1

      Shouldn't madvise be sufficient?

      --
      The Tao of math: The numbers you can count are not the real numbers.
    54. Re:Problem of perception? by AmiMoJo · · Score: 1

      I have noticed that FF4 has to re-load images from disk a lot more than FF3 did. I set the memory cache to 1GB years ago (browser is my most used app and the computer has 6GB of RAM) and even with a few image heavy sites open I could flick between tabs instantly. Now it has to re-load the images every time.

      So clearly FF4 does ditch more data than FF3, but for me the effect is detrimental to performance.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    55. Re:Problem of perception? by AmiMoJo · · Score: 1

      That isn't how most apps cache data though, especially web browsers. When Firefox downloads an image it stores it on disk in the cache. If it needs to free up the copy in memory then there is no need to page anything out to disk because it is already there.

      The OS does this to some degree with file types it understands. For example executable code is already stored on disk so does not necessarily have to go into the swap file. There is overhead re-loading data from files instead of swap, e.g. JPEG images have to re-decoded and executable code might have to be partially re-linked, but that is more than made up for by reduced disk access.

      The app needs to be able to tell the OS "you can trash this data because I can reload it", but there is no mechanism for that. Well, the OS can do it with some program data like the binary and GUI elements if they are using OS APIs to load them (DLLs, WPF forms etc) but we could go well beyond that.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    56. Re:Problem of perception? by Johann+Lau · · Score: 1

      "32-bit versions of Windows ignore the flag"

      so what you're saying is: good point about there being no way to do that, except that there is a way, except that way doesn't actually exist... ? heh ^^

    57. Re:Problem of perception? by maxwell+demon · · Score: 1

      Discardable memory does not exist in a way applications can use.

      From what I understand, on Linux madvise with option MADV_DONTNEED is exactly that.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    58. Re:Problem of perception? by qubezz · · Score: 1

      The problem is evolution of technology, and these Windows speedup "features" quickly becoming obsolete. A laptop with 6GB RAM is mainstream now - with this much hardware and a commit charge that never peaks 2GB, there is no need for even a page file and an OS should be optimized to do without instead of being so badly optimized that it still swaps to disk. My SSD drive is 10x faster than any USB flash drive, but Windows still thinks adding a USB stick as a Readyboost cache between DDR3 and a 600MB/s SSD RAID is a good idea.

      Firefox should just keep an eye on system resources and be ready to dump it's cache in the bitbucket if it looks like another application is starting. After that it can start re-compressing or tossing data (think lots of pictures loaded in ignored old tabs) that it can reload. An option where you can choose if you want fast memory hog Firefox or limited RAM Firefox so your whole system sucks less.

    59. Re:Problem of perception? by owlstead · · Score: 1

      "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."

      And here lies the problem. Current operating systems/runtime systems are not very advanced at all. They provide way too little functionality. Heck, you cannot even disallow an application to take memory in any sane fashion. And they do not, for instance, provide applications with an OS assisted way of memory management (or thread management etc). One problem is, of course, that if you do add functionality and move into a runtime system that assist applications and users more, then the applications will have to be programmed to actually live in that environment. So portability would certainly suffer. In the end, I think we will move into a world though where this has to take place.

      But currently we live in a world where applications still need to install *themselves*, then get rights for each and every document you own, take as much memory and CPU as they want, keyboards get locked out even to the operating system etc. And we have the GPU that has always been a horror to keep in line because of performance constraints. The place where we do see some (slightly squeamish) steps forward is of course mobile phones. Personally, I think that there would be a rather large market for a more secure and managed software environment, especially regarding things like nuclear reactors, submarines and such.

    60. Re:Problem of perception? by icebraining · · Score: 1

      If parent is letting a user's process take all the available memory of the machine (s)he has bigger problems. Quotas exist for a reason.

    61. 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

    62. Re:Problem of perception? by aix+tom · · Score: 1

      That's why most applications should NOT massively "Cache data from the disk" themselves.

      The Application should just tell the OS "gimme that file/block". The OS can then decide, when enough ram is available, to cache that file in the file cache in RAM. When RAM gets more sparse the OS can decide to delete files in the cache that have not been accessed the longest.

    63. Re:Problem of perception? by Anonymous Coward · · Score: 0

      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.

      And that's true. Having free RAM not utilized by applications allows the operating system to use them for caching (i-node, data and other stuff). This greatly increases performance:

      (1) Sometimes when programming I have a bug in a program so it tries to allocates infinite amounts of memory.
      (2) Memory is full, the program is killed by the OOM killer
      (3) Computer is slow, because all caches are now empty

      Try it our self.

    64. Re:Problem of perception? by maxwell+demon · · Score: 1

      The app needs to be able to tell the OS "you can trash this data because I can reload it", but there is no mechanism for that.

      s/there is no/the programmers don't use the/

      --
      The Tao of math: The numbers you can count are not the real numbers.
    65. Re:Problem of perception? by hairyfeet · · Score: 1

      You argument would hold water if all the other browsers did that but they don't. Hell even shitastic IE don't bitchslap the living shit out of resources like FF 4. And like I said Chromium based have more things to deal with, like low rights mode, yet they use less resources and NEVER, I repeat NEVER lose responsiveness.

      And are you saying FF should have a warning label that says "if you are on a mobile device like netbook/laptop, or on a low resource device like nettop or office machine, please don't use this product as it is unsuitable for purpose"? The VAST MAJORITY of laptops and thin and lights sold today are the sub $500 models, these come with 1-2Gb on average, most single cores or low end duals like Intel Atom and Celeron and AMD Sempron and Neo. You telling me ALL those people should avoid FF like the clap? When they have competition in the form of Chrome and its kin climbing the charts? Sounds like a good way to ensure they don't exist in 3 years my friend.

      Like it or not rising prices have made the low end both from a power usage as well as price perspective THE growth market, and I can tell you from experience on the latest Atom and Neo netbooks, which frankly run both Win 7 HP and Dragon just find and are nice and peppy, that FF in its current incarnation is simply unsuitable for purpose. As I said you better make a sandwich if you are launching on anything less than a 3GHz P4 with 2Gb of RAM, which is about double what you are getting out of your average netbook.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    66. Re:Problem of perception? by Sabalon · · Score: 1

      RAM is good - free ram is wasted. However when I leave my machine locked overnight and FF's memory usage goes from 200MB to 1200MB, that's probably bad, unless it's trying to pre-cache the Internet for me. :)

    67. Re:Problem of perception? by IANAAC · · Score: 1

      People are browsing from the server? Your problem isn't Firefox....

      Perfectly OK. Ever heard of a terminal sever? Or Citrix? Whoever admins the box should know about quotas.

    68. Re:Problem of perception? by pinkeen · · Score: 1

      Yep I agree. I don't know much about kernel-level memory management, except for the general idea of paging, but consuming ram because its available seems inherently wrong.

      If every (non-modal unlike games) app used memory like this, you would have a huge amount of pages swapped to disk at any time. Doesn't considerable increase in page table's size decrease performance for every running app? What about the swapped pages? There is a high probability that at some point in time a lot of them will be swapped back to ram - causing slowdowns. Lots of apps - lots of slowdowns. How is OS supposed to know all that?

      I always thought, as an application developer that you should limit your ram use to the minimum required for smooth experience, ie. keep in ram the data that is most frequently used and can be needed at any time. I mean the vital stuff needed for the GUI and the task user is currently performing. I don't know what's changed that suddenly everybody started to forget about this.

      Well, I imagine that with web browser things can get complicated. How to know what should be cached? Maybe just keep track of the pages the user revisits most frequently? I know that pages are composed of a lot of media nowadays but heck, does firefox need to keep in RAM images that I viewed few hours ago? I don't see any justification for its current RAM usage.

      This level of fine-grained memory management should be done in the application layer. What would be the point of creating a vast API that tries to shift this responsibility to the OS, IMHO it would be just another piece of bloat. That's if somebody did it - right now the OS isn't meant to handle this kind of memory management.

      One more thing to make my babble clearer - app can free its memory and OS can't free app's memory, it can only swap. 500GB dedicated swap drives anyone?

    69. Re:Problem of perception? by squiggleslash · · Score: 1

      Up to a point. Look, if Firefox is using 66% of my memory, and nothing else is, then that's one thing, but most users are using more than one application, and if all take the same mindset, then how is this good?

      Further, Firefox with a few (10-15) tabs open currently consumes around 1.5G of RAM on my older laptop. What's the justification for this? Exactly what can it possibly be caching that would take up 1.5G? That's 100 megs per tab! What, exactly, about each tab takes 100 megs to store? What the hell is it doing, converting all of the internal binary data structures into XML or something?

      The reality is this, with Firefox 4 I now have regular crashes on every computer I run it on, crashes that usually occur when I'm away from the computer. I have regular stalls where the browser becomes unusable for a minute or two while the harddrive spins, presumably reflecting the operating system coping with a memory hogging app. I've set the memory preferences in about:config to no avail, it still does this crap all the time. And I'm not seeing some dramatic improvement in performance, Firefox 4 appears, to me, to be no faster than Firefox 1.x was, and that didn't regularly stall on me.

      Firefox 4.0 has a very nice UI and a lot of nice fixes. There's no reason for me to prefer Chrome in a normal world, but I've found myself using Chrome more and more of late because it works and Firefox doesn't, and it's the memory issue that's killing Firefox.

      --
      You are not alone. This is not normal. None of this is normal.
    70. Re:Problem of perception? by cb88 · · Score: 0

      Javascript can peg a core.... I've had the XUL UI its self hang up on me before but I do tend to run the nightly versions. Heh I've seen firefox pop up a notice saying that script is taking too link well close it and you lose the ability to close tabs XD... sigh I thought it was comical anyway.

    71. Re:Problem of perception? by Lennie · · Score: 1

      Some things I'm thinking of right now:

      1. some things need to be contructed from source/decoded/uncompressed, you might not want to do this on the fly each time. So that is why it is kept in memory for a while atleast. Like the layout of a webpage. Or the compressed image which was stored in a base64-data-url before.
      2. could a small change to mmap fit that description ?

      --
      New things are always on the horizon
    72. Re:Problem of perception? by Anonymous Coward · · Score: 0

      Such a long comment and this is your punchline?

      I have way more RAM than I've ever seen my computer manage to use.

      Don't quit your day job just yet.

    73. Re:Problem of perception? by bill_mcgonigle · · Score: 1

      How would this work?

      would you madvise MADV_DONTNEED for a cache memory block and then when you want to access the cache do a MADV_WILLNEED on the block and check for ENOMEM, rebuilding the cache in that instance?

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    74. Re:Problem of perception? by Anonymous Coward · · Score: 1

      I've got 6 other tabs open while posting this, and a Firefox footprint of 44MB. The trick is to find a version that leaks slower rather than faster, allocs sensibly rather than furiously and greedily, and frees aggressively and enthusiastically.
      overall: 3.6 is pretty good, 4.0 is a trainwreck, and 5.0 is heading in the right direction but isn't really there yet.
      NoScript can make a huge difference on some sites. If the JIT can't see it, the JIT can't burn RAM compiling it and then holding on to multiple representations of it.

      Your Parent is sort-of not wrong about one thing though, which is that 4.0 is very happy to alloc and very bad about *releasing* memory, even if it hasn't actually lost it. ("Yet"? :P).

      After literally years of "it's not a leak, it's fragmentation!" and "it's not fat, this sweater's just really baggy", it's *great* to see the Firefox devs actually admit to the problem and start to go after it aggressively. (njn deserves credit for leading the charge, but it seems to be catching on).

      FF does get a lot of blame for things that aren't *entirely* its fault, like urlclassifier, but 4.0 deserves most of the abuse it gets. I'm sure a ton of energy went into HTML5, but far more went into e-peen contests with Google and MS over who could be 0.00001s faster on an artificial benchmark that nobody but them gives a crap about, or copying bad UI ideas just to be able to say "me too!", instead of things like "How does the browser feel to the *user*?"

      parlancex: "paying attention to global system memory levels and caching less aggressively when there is RAM pressure".

      Seriously? I mean, nice buzzwords and all, but, eesh...

      [roleplay]
      "global system memory levels" are None Of Your Damn Business, <i>App</i>. How about you worry about the hundreds of MB you can't seem to find, and I'll worry about the VMM?
      Here's a clue: if you can't even manage your *own* memory, how on earth do you think you'll make things *better* by trying to work out what everyone else is doing with theirs?
      [roleplay]

      Sure, you can poke around at OS-level things and come up with a hack that "works" the way you want it to for a given set of test cases. And a dozen people have actually suggested that as a "fix" in mozdev in the last week or two.
      Or, someone could, I dunno, maybe try and ACTUALLY fix the code so it wasn't the CAUSE of the pressure in the first place, maybe?

      And that's why I expect 5.1 or 6.0 might actually be an upgrade from 3.6, because although there are still plenty of TeamA's around, there's a noticeable number of B's now as well.
      (and I get the A's, I really do: long and very late project, then a shortened schedule for the next one. some days, even a moronic but easy hack is a lot more attractive than Doing Work).

      This isn't a DOS world. You play nice with the other children, or you GTFO. If one browser manages its memory so badly that it incites thrash - which, as you point out - is VERY noticeable to even the dimmest user let alone an ADHD teen, and another browser doesn't, the second one "wins", the end.

      <li>
      Warning - anecdote

      > vista ... superfetch

      So that's what it was! A couple of years ago I was visiting my dad, and he had a Vista notebook that like yours took about 15 minutes to get to a usable state, and the HDD sounded like a lumber mill. He would literally turn it on and then go and do something else for half an hour. And this wasn't some $200 piece of junk: it was a beefy dual-core 2GHz+ machine with far more RAM, disk, and horsepower than he could ever possibly need.

      I spent about 4 hours cleaning all the shovelware off it, disabling indexing, tuning services, and so on: I got it down to under 10 minutes, but I could NOT figure why the heck it still took sooo long to start. I caved a couple of days later, burned a LiveCD, and set him up with a dual boot. It comes up in about 30 seconds.

      So, thanks to superfetch, I'm closer to my parents

    75. Re:Problem of perception? by Anonymous Coward · · Score: 0

      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')

      So you change your tree to use its own allocator. The rest of the code is untouched.

      Then those worse case behaviours become _very_ worse case behaviours which can't be changed without a fundamental rearchitecture of your software.

      See above.

    76. Re:Problem of perception? by Anonymous Coward · · Score: 0

      It's a real shame that memory management has really stopped progressing since virtual memory systems were made.

      Well, that's false. Memory management HAS eveolved... they call it automatic garbage collection. And you know what? The result is even worse.

    77. Re:Problem of perception? by aminorex · · Score: 1

      This is the same rationale that has turned firefox into a bloated unusable memory hog, and created a problem so big that according to Johnny Stenback the problem is too big for anyone to fix. People have been complaining incessantly about firefox's memory hogging and how it turned their compuiters into unusable paper weights for a decade, and this "rationale" has been trotted out every time. That's why everyone switches to Chrome or Opera eventually.

      --
      -I like my women like I like my tea: green-
    78. Re:Problem of perception? by aminorex · · Score: 1

      "Don't try to hack around problems at the wrong layers"

      When you say "don't worry about fine-tuning what's "in memory"' you demonstrate that the layer in which the problem resides is your mind.

      --
      -I like my women like I like my tea: green-
    79. Re:Problem of perception? by Anonymous Coward · · Score: 0

      You may want to check out Devil's Pie if you run a GNOME based desktop. I assume there would be a similar utility for KDE but I haven't actually looked. It seems an uncommon but easily accomodated use case.

    80. Re:Problem of perception? by mysidia · · Score: 1

      Secondly, the OS really doesn't have any intelligent insight into the usefulness of a particular allocation to an application. An application will always be more aware of what cached data is more useful than others.

      Then it would be better for the API to provide an application a way of registering a callback, and the OS sending the application an interrupt requesting it to free memory. Something like you know "Hey you, yeah you, your memory usage is excessive, your memory and CPU scheduling priority are lowered, and your pages are being swapped out to disk"

      Based on user preferences or system conditions, the applications would be sent a signal when their memory usage is considered excessive, or the system is short on resources -- should the application fail to start freeing up the least important cache pages, based on the system admins' configuration -- the application could either be denied more memory/automatically terminated (based on runaway behavior detected and ignoring interrupts), or the OS could then begin to swap the application, and continue to fire the interrupt periodically, until either enough of the application is swapped out, or the application freed up enough memory.

    81. Re:Problem of perception? by smash · · Score: 1

      Write it to disk and let the os use its disk cache if ram is available.

      --
      I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
    82. Re:Problem of perception? by MikeBabcock · · Score: 1

      I have 8GB of RAM and I've seen Firefox use up all of it in a few hours.

      Programs that over-allocate are a problem, no matter how intelligent your OS tries to be (I run Linux fyi) or how much RAM you have.

      --
      - Michael T. Babcock (Yes, I blog)
    83. Re:Problem of perception? by MikeBabcock · · Score: 1

      Thought puzzle:

      Which one understands which pages are needed better: the OS or the Application?
      Which can decide to set aside data that won't be needed for a while more intelligently?
      Which can easily predict if it will need to make large allocations in the near future?

      Applications depending entirely on the OS to handle memory pressure situations and acting stupid are inefficient in the long run and cause performance problems.

      A similar situation (and argument) exists with how Apache handles forking and threads (much much faster than just letting the OS deal with it) or how Squid handles file names.

      Sure, you can make the OS efficient at forking, or the filesystem efficient at name finding, or malloc more efficient at allocations, but the user space application knows better than the OS and can do much smarter things like pre-allocating large chunks of memory or freeing unused data that it knows it can find on disk later if the user really wants it.

      Intelligent application handling of memory is better than not.

      --
      - Michael T. Babcock (Yes, I blog)
    84. Re:Problem of perception? by nospam007 · · Score: 1

      "Me, old? (pushes a vertebrae back into position, ah thats better)"

      I see you're also the chiropractic spammer.;-)

    85. Re:Problem of perception? by sjames · · Score: 1

      A program can do it's best to not gratuitously touch pages so the OS can make better decisions (which will inevitable be based on the last time a page was touched and possibly how frequently).

      For instance garbage collection can play havoc with paging. Think of all the objects that are kept around as a speculative cache but get swapped in every few minutes to see if they have been forgotten or not.

    86. Re:Problem of perception? by Anonymous Coward · · Score: 0

      At my work it's company policy for all Win7 machines to have superfetch disabled, because of the many many issues we run into while it's enabled. It's not fun having your disk thrash for hours while you're trying to save something that hasn't been saved in a while. Invariably the computer gets hard reset and an entire day can be lost, so superfetch had to go. Better to have a working computer than an inert brick, I always say.

    87. Re:Problem of perception? by arth1 · · Score: 1

      And allowing users to use large amounts of memory occasionally is also within reason. The problem is that quotas don't know whether it's a reasonable use or not; they toss the baby out with the bath water.

      cgroups are better, but a damn hassle to admin. And they too become blind if the user is in a VM - you have to restrict the entire VM, which may not be what you want.

    88. Re:Problem of perception? by Anonymous Coward · · Score: 0

      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.

      Yes, using RAM if you don't really need it and other things need it, IS BAD. My computer at work has 2GB of RAM and Windows XP on it (just so you know). About half of that RAM is already used up after boot by programs that are shoved on me by IT (yes, that includes a memory hogging virus scanner (250MB+) and Outlook (200MB+). After that, because I need to develop some software, I start eclipse, which requires another 200+MB after start and will rapidly gather heap allocations up to about 800MB (because that's about the max I set. Unfortunately, eclipse is pretty unusable w/ the plugins I require if I set less. Starting the webapp in debug mode will eat up another 200+MB. Oh, did I mention that I am running an Oracle XE which will allocate 600MB of RAM just after start?

      Of course, as I'm developing a web app, I require Firefox (and maybe some other browser(s). So FF eating up memory is big problem for me indeed (although I must admit, that it's not the only memory hogger, but since TFA is about FF ...

      Of course developing that web app is not the only thing I do and I regularly need to run some other programs, some of which churn through some amount of data (hundreds of MBs), which would benefit from some free RAM to be used as filesystem cache etc. However, since I'm usually never below 2GB memory usage anyway ... well, you get the picture. Yes, developing on that machine is damn frustrating and all because programmers thought using up RAM without thinking twice was ok.

    89. Re:Problem of perception? by Anonymous Coward · · Score: 0

      Rule one of Firefox: don't make the software as good as possible, blame something else instead.

    90. Re:Problem of perception? by maxwell+demon · · Score: 1

      Thanks for the link. However it still does only part of the problem: You still would have to have a way to create a script detailing the current configuration of the Firefox windows, and apply it only in case of a Firefox restart (and deal with the fact that Firefox window titles change as web pages are loaded, and two non-equivalent windows may have the exact same titles).

      Indeed, I don't think there's a way to solve the problem without considerable cooperation between Firefox and the window manager (which would probably mean a window manager aware Firefox extension).

      --
      The Tao of math: The numbers you can count are not the real numbers.
    91. Re:Problem of perception? by hairyfeet · · Score: 1

      See? That kind of behavior is simply inexcusable. BTW have you had a "phantom video" yet? that is where you close a video playing in a tab other than the one you are in and the video keeps playing which you can tell because of the audio still going and the ONLY way to stop it is a full killing and restart of the browser. Also if you go to any pron or driver downloads sites you might want to set a master security password to protect your passwords to keep from being hit by the XSS bug that will spam everyone in your address book if you use Yahoo Mail. That one only seems to affect FF BTW, doesn't work on webkit.

      As much as I hate to say this, as someone who has used FF since it was named Phoenix and the suite before that, if you haven't tried Comodo Dragon you really should. It is really head and shoulders above FF ATM, and many of the extensions you are used to in FF like ABP now are there for Dragon (simply use Chrome extensions). It doesn't hang, or suck memory, or fall for XSS attacks like the one above, can run for days without going "runaway RAM" like FF seems to do, it is just really better built all around.

      Personally I think it is Gecko. I think Gecko just wasn't ever designed for sandboxing and multithreading and instead of doing a rewrite they are trying to bolt on functionality that just isn't gonna work. It is like bolting a blower to a Pinto. Sure it might work for a little while, but it will eventually tear itself apart.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    92. Re:Problem of perception? by Anonymous Coward · · Score: 0

      Um... Desktop virtualization Remote Desktop Services X Window System Virtual Network Computing. HTH, HAND.

      That's your mistake right there. Servers shouldn't be running X

    93. Re:Problem of perception? by berniemne · · Score: 1

      Oh dude, you don't get the problem. Currently my IDE eats up 10Megs and it currently compiles. File manager is eating up 14Mb. Age of Connan patcher 150Mb. Firefox with only 5 tabs 201Mb (ROFL wtf?). I'm planing open at least 1 more Photoshop and a 3DSMax instance. Get this, you don't necessery need to allocate all availabale memory. It could be used by other applications.

    94. Re:Problem of perception? by julesh · · Score: 1

      No, there is a method to do it as part of the API. It happens that no pages are ever discarded, but programs could be using it right now, and an OS update could cause them to be discarded in the future.

    95. Re:Problem of perception? by Johann+Lau · · Score: 1

      "could" being the keyword here. as you said. "it was extremely useful under Win16 I have often wondered why MS removed it." it (the actual functionality) was removed == it is no longer there. yes, it "could come back", but you could say this about anything, really :P

  28. Re:Memory problem? by Anonymous Coward · · Score: 0

    What reason could you possibly have for keeping 20 tabs open for 2 days?

  29. They could also use a DiskShrink team by FridayBob · · Score: 1

    As far as I'm concerned, Firefox could also use a DiskShrink team, although perhaps DiskPerformance would be more accurate. My site uses OpenAFS across several locations with 6Mbps to tie them together. The workstations run Debian squeeze with Xfce. It all works fine, but in the beginning we soon discovered that Firefox wasn't going to cut it. Although it was our preferred browser, even with its cache disabled it was too slow when the user volume, which contains the home directory, was not on the local file server. We ended up switching to Google Chrome, which is much faster in this respect.

  30. 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 Anonymous Coward · · Score: 0

      Likely it will, they both use xulrunner which is probably the where the work will take place.

    2. Re:Needs to be all of Mozilla by Anonymous Coward · · Score: 0

      Thunderbird is only using 80mb on my machine currently and I have 5 Imap accounts, with my main account having a ton of email in it. Its probably caching email headers on the plethora of accounts for fast response. Either way, I never see thunderbird as a source of a memory problem on my computer.

    3. Re:Needs to be all of Mozilla by Anonymous Coward · · Score: 0

      i concur !!!!

    4. Re:Needs to be all of Mozilla by hedwards · · Score: 1

      The problem I have with Thunderbird is the frequent freezing of scripts. It's good for them to work on cutting down the RAM consumption, but I do think it's a good idea to keep in mind the context in which this is all taking place.

    5. Re:Needs to be all of Mozilla by surveyork · · Score: 1

      50 MB here.

      --
      2019 is going to be the year of Linux on the desktop.
    6. 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'!"
  31. Re:Memory problem? by Anonymous Coward · · Score: 0

    Laziness.

    Not that I blame him; tab implementations promote laziness w.r.t keeping tabs open because the tab management sucks so hard. Tabs haven't changed in >10 years.

  32. It's not a problem of perception. by Anonymous Coward · · Score: 1

    My computer has 8 GB of RAM, and I don't use swap. Now, just because it has 8 GB of RAM that does not mean that I want Firefox using all 8 GB! I need some left over for Eclipse, Evolution, and the other memory-intensive applications I unfortunately need to use.

    So I hope you can understand why I get slightly annoyed when I see Firefox consuming 7500 MB of RAM. It's clearly using that much due to memory leaks and sloppy programming. I know it's not due to aggressive caching or anything like that, because I haven't visited over 7 GB worth of pages since starting up Firefox about 10 minutes ago.

    Firefox has a serious problem with wasting memory, and it needs to be fixed. It's as simple as that.

    1. Re:It's not a problem of perception. by parlancex · · Score: 1

      If Firefox is using 7500MB of RAM I agree, obviously that is a memory leak problem and that needs to be fixed. Personally I've never seen it, but since I have a fast computer I don't mind closing Firefox when I'm done with it, so it doesn't stay running for weeks at a time either.

    2. Re:It's not a problem of perception. by calc · · Score: 1

      Firefox and all the Netscape/Mozilla based browsers before it have always seemed to use all available memory on my system. I do not close my browser down often though so it may be that it is just really leaky like the previous poster said.

    3. Re:It's not a problem of perception. by arth1 · · Score: 1

      Personally I've never seen it, but since I have a fast computer I don't mind closing Firefox when I'm done with it, so it doesn't stay running for weeks at a time either.

      Keep in mind that not all users are like you, nor all systems are single-user systems. I've had VMware/VNC/RDP users who exit their session, not understanding that things keep running, and FIrefox continuing to eat more and more memory. Someone who was away for weeks ended up using 2.5 GB of a server's memory, just for forgetting to close Firefox.
      On servers, having to resort to cgroup to limit memory usage isn't good - it creates work, which costs money. And on VMs, it's not even feasible, cause the Dom0 doesn't see what each DomU does. Sometimes there's a good reason for high memory usage. But most of the time, it's fscking Firefox.

  33. Holding it by Anonymous Coward · · Score: 0

    I wonder how a lot of people use their browser. I hear of people that have it open all day.

    That's completely the opposite of how i use the browser. Every couple of hours i get to the point were i have so few tabs open that i can relauch without it interupting my workflow. This keeps memory leaks at bay

  34. Re:Considering the price of memory, why even bothe by scdeimos · · Score: 1

    Firefox didn't even exist a decade ago.

  35. Thank you, Mozilla by scdeimos · · Score: 1

    Can you get your MemShrink guys to look at Nautilus and gnome-panel when they're done? :)

    1. Re:Thank you, Mozilla by owlstead · · Score: 1

      In my opinion those applications have more serious issues than memory use. The fact that they crash quite a lot, or lock up would come to mind. And that they are terrible pieces of crap regarding user experience. It's that I hate the K desktop so much that I don't switch, but it's the *only* reason.

      Anyway, I'm currently on 22% used by programs, with 8 GB of memory. Before they've found and fixed all memory problems, 64 bit 8 GB will be the norm for desktop systems.

    2. Re:Thank you, Mozilla by snadrus · · Score: 1

      Look at the Marlin project and Xubuntu. They both use GTK3, yet have unloaded a lot of Gnome libs.

      --
      Science & open-source build trust from peer review. Learn systems you can trust.
  36. 900MB-1GB by Dwedit · · Score: 1

    Firefox 4 usually uses about 900MB of RAM after running for several days. This is not acceptable. But flaws in Chrome keep me coming back to Firefox.

  37. So much comlaining by Anonymous Coward · · Score: 0

    FF is OSS. Nobody's looked to see how the memory is used?

  38. Firefox Memory Limit by Anonymous Coward · · Score: 0

    It would be nice if a limit could be set to the maximum amount of ram that Firefox could use at one time. The biggest issue I have is that I will leave the browser open for a week or two at a time opening and closing numerous tabs over that time. Firefox NEVER releases any of the memory from the tabs that I closed so in no time FF is using over 1GB of RAM. I don't mind FF using the memory as I have 10GB, but as soon at it starts using around 800MB FF becomes very very laggy and every little task in the browser begins to peg my CPU for a few moments. When this happens I know it's time to restart the browser and when it comes back up it's only using 200MB of RAM and is humming along nicely. FF has had major memory issues since version 2.0 or so.

    Given this, I believe chrome to have the best memory management technique as each tab is it's own process (not thread) and the memory is released when the tab is closed.

  39. How about CPU utilization? by kimvette · · Score: 1

    When are they going to do something about CPU utilization? Firefox very regularly pins the CPU (well one core of a processor anyhow, showing it's not multithreaded well) at 100%, sometimes after just a few minutes, to the point where I can't File -> Exit, forcing the use of either task manager (on Windows) or kill -9 (on Linux). I've even blown away my profile, followed the usual tips, and yet it still happens. Now I can understand blaming a poorly-coded extension, or a corrupt profile, but why does it consistently occur on both Linux and Windows (I haven't used Firefox consistently on OS X)? I can even understand blaming the Flash plugin, but if that were the case, why are Opera, Chrome, IE, Safari, and other browsers completely unaffected by this issue?

    Firefox has been problematic since the 2.x days, and only just now they're acknowledging this. Better late than never, I suppose.

    --
    The Christian Right is Neither (Christian nor right). See: Matthew 23, Matthew 25, Ezekiel 16:48-50
    1. Re:How about CPU utilization? by dlgeek · · Score: 1

      Are you sure that isn't flash? I've seen this happen but it's VERY consistent that it's flash that's actually causing it (but the plugin runs in the firefox process space). Actually, I see my CPU automatically jump from around 10% to 75% (out of 200%) as soon as I open a page with flash in it, up to around 100% (one core) when I play a flash video, then back down to 10% as soon as I close that tab.

    2. Re:How about CPU utilization? by perryizgr8 · · Score: 1

      i use flashblock and i still see continuous cpu usage after 1-2 days.

      --
      Wealth is the gift that keeps on giving.
    3. Re:How about CPU utilization? by kimvette · · Score: 1

      Other browsers don't come to a complete halt to the point where you can't even close a tab or the application itself. As I said, even if Flash is the root cause, Firefox is the problem because Firefox can't handle it gracefully and just kill the plugin.

      --
      The Christian Right is Neither (Christian nor right). See: Matthew 23, Matthew 25, Ezekiel 16:48-50
  40. I'm more concerned about CPU usage.. by the_rajah · · Score: 1

    With the 8 tabs I normally have open in FF, eventually the CPU usage will spike when I'm switching from one tab to another and it will lock up for several seconds. Looking at it with the task manager, it says Firefox (Not Responding). WTF is with that? I close it, reopen it, restoring the same tabs, and I'm OK for a while. Annoying. I tend to simultaneously use FF, Chrome and Opera on XP. FF is the only one with this problem.

    --


    "Do the Right Thing. It will gratify some people and astound the rest." - Mark Twain
    1. Re:I'm more concerned about CPU usage.. by johncandale · · Score: 1

      I don't think you understand CPU usage

  41. No kidding. by Anonymous Coward · · Score: 0

    Noticed that one myself. Run Firefox, my Macbook Pro is cookin'. Chrome? Not a problem.

    Firefox these days is my 'disposable' browser, where I keep crap like Slashdot and porn. Real work gets done in Chrome.

    1. Re:No kidding. by Rufty · · Score: 1

      Yep, that's on my Macbook.

      --
      Red to red, black to black. Switch it on, but stand well back.
  42. Let's do a test by Daetrin · · Score: 1

    I just closed Firefox. Let's open it back up again. It opens one google tab and is using 120 megs private bytes and 361 megs virtual according to Process Explorer. Not too bad.

    Now let's open up 50 tabs, all for for http://en.wikipedia.org/wiki/Main_Page

    After spinning for a bit, Firefox is now at 396 megs private and 717 megs virtual. Let's close 49 of the tabs. After letting it sit for a little bit it drops to 333 megs private and 717 megs virtual. Let's repeat that a few times without closing the window.

    50 tabs open: 525 megs private, 839 megs virtual.
    49 tabs closed: 466 megs private, 846 megs virtual.
    50 tabs open: 660 megs private, 1002 megs virtual.
    49 tabs closed: 596 megs private, 1001 megs virtual.
    50 tabs open: 775 megs private, 1122 megs virtual.
    49 tabs closed: 730 megs private, 1123 megs virtual.
    50 tabs open: 906 megs private, 1252 megs virtual.
    49 tabs closed: 839 megs private, 1253 megs virtual.
    50 tabs open: 1002 megs private, 1339 megs virtual.
    49 tabs closed: 937 megs private, 1338 megs virtual.
    50 tabs open: 1105 megs private, 1438 megs virtual.
    49 tabs closed: 1043 megs private, 1438 megs virtual.

    So it took 7 iterations (about 350 pages all told) to reach the point where Firefox was consuming over a gig _each_ of private and virtual memory with just a single tab open. Now if i ever reached this point in normal usage of course i'd shut it down to free the memory, but under normal usage after going through that many pages i'd have at least a dozen tabs open to things that i was still using.

    And remember that that was just 350 copies of the same page, the main page for Wikipedia, which i wouldn't exactly consider a memory hog.

    --
    This Space Intentionally Left Blank
    1. Re:Let's do a test by jesser · · Score: 1

      That's not so great. If you upgrade to [Firefox 6] Aurora, and look in about:memory after doing that, where does Firefox think all the memory going?

      --
      The shareholder is always right.
    2. 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

    3. Re:Let's do a test by jesser · · Score: 1

      There are some bugs related to sqlite memory use, bug 411894 and bug 650649.

      I don't know why we bother caching parts of the sqlite files at all. That's what mmap and OS filesystem caches are for.

      The good news is the sqlite memory use won't keep growing. At worst it will grow to about the size of the database, and then remain steady. It's only a significant fraction of Firefox's memory use when Firefox isn't using much memory.

      --
      The shareholder is always right.
    4. Re:Let's do a test by Anonymous Coward · · Score: 1

      Well, ran a test along your lines.
      http://m8y.org/tmp/ff_mem_check.txt
      Upshot:
        1 about:memory
        9955 nemo 20 0 284m 52m 26m S 0 1.7 0:01.84 firefox-bin
        1 about:memory + 50 wikipedia
        9955 nemo 20 0 659m 275m 29m S 0 9.1 0:21.29 firefox-bin
        1 about:memory
        9955 nemo 20 0 634m 118m 30m S 1 3.9 0:23.60 firefox-bin
        1 about:memory + 50 wikipedia
        9955 nemo 20 0 666m 276m 30m S 1 9.2 0:41.88 firefox-bin
        1 about:memory
        9955 nemo 20 0 642m 117m 30m S 0 3.9 0:53.81 firefox-bin
        1 about:memory + 50 wikipedia
        9955 nemo 20 0 675m 284m 30m S 0 9.4 1:11.83 firefox-bin
        1 about:memory
        9955 nemo 20 0 635m 110m 30m S 0 3.7 1:15.16 firefox-bin
        1 about:memory + 50 wikipedia
        9955 nemo 20 0 670m 278m 30m S 4 9.2 1:33.52 firefox-bin
        1 about:memory
        9955 nemo 20 0 637m 111m 30m S 1 3.7 1:36.93 firefox-bin
        1 about:memory + 50 wikipedia
        9955 nemo 20 0 672m 283m 30m S 0 9.4 1:55.41 firefox-bin
        1 about:memory
        9955 nemo 20 0 643m 117m 30m S 1 3.9 1:58.83 firefox-bin
        1 about:memory + 50 wikipedia
        9955 nemo 20 0 668m 280m 30m S 0 9.3 2:17.06 firefox-bin
        1 about:memory
        9955 nemo 20 0 655m 147m 37m S 1 4.9 2:22.03 firefox-bin
        1 about:memory + 50 wikipedia
        9955 nemo 20 0 702m 307m 37m S 0 10.2 2:41.23 firefox-bin
        1 about:memory
        9955 nemo 20 0 673m 149m 37m S 0 5.0 2:44.20 firefox-bin

      Gotta say, not seeing your dramatic results...

  43. Re:Considering the price of memory, why even bothe by Browzer · · Score: 1

    you right... It has not been a decade, but it does have memory issues since the beginning of FF.

  44. Re:Considering the price of memory, why even bothe by bunratty · · Score: 1

    Up to Firefox 3.6, Firefox used less memory than other browsers. I'm sure Firefox has had memory issues, but then again, other browsers seem to have worse memory issues. All browsers also experience crashes and security vulnerabilities. The question is one of how severe the problems are, not whether or not they exist. If you read the linked articles closely, you'll note they are about issues new to Firefox 4. The memory issues have become more severe in the latest version. That's what the new MemShrink team will work on.

    --
    What a fool believes, he sees, no wise man has the power to reason away.
  45. Please. by MrEricSir · · Score: 1

    Please, don't remind me of X 10 and their pop-under ads for webcams.

    --
    There's no -1 for "I don't get it."
  46. Seem to remember by Anonymous Coward · · Score: 0

    I'm no MS fanboy, but I remember when Slashdot was lam-basting Microsoft Office and IE for being such a memory pig - and it never ate up this much ram. The comments were *scathing*. Yet here we with Firefox sucking up just obscene amounts of memory and narry a peep? C'mon people - if we really are about technology - we shouldn't be playing favorites. Call spades a spade and improve it.

  47. Re:Memory problem? by Anonymous Coward · · Score: 0

    Laziness is right. But there's more to it than just "tab management sucks". Bookmark management sucks too. It's easier to just open a tab for a page you will go to a lot than to open a tab and click a bookmark each time you want to go there. Those seconds add up surprisingly fast, when you do something 1000 times a day.

  48. Bolt-on? by Anonymous Coward · · Score: 0

    Maybe they should just bolt-on something like Boehm GC and be done with it. Yeah, it's not a pretty solution but if they've got a million LoC that leaks like a sieve it might be practical. Not sure how much slowdown Boehm would add. Probabl not much, especially if you can time mark-sweep to user actions like closing a tab or something.

  49. Plugin to restore functionality by Anonymous Coward · · Score: 0

    I like the excessive ram usage you insensitive clog!

  50. RAM use in FF Auroa VS. IE9 vs. Chrome by Anonymous Coward · · Score: 0

    Interesting. However, I have IE9 , Chrome and Aurora all open with the following tabs" iGoogle, Yahoo, MSN, Fox News, CNN and New Tab..IE and Aurora have Google Toolbar which, of course Chrome does not have. Guess the Mem hog? CHROME it has 14 chrome.exe processes running now at an expense of 282 +/-. Aurora is holding at a level between 182k and 206k, while IE9 is between 186k and 203. So where is the hog???? Just my observations tonight

  51. Big problem by BreezeC · · Score: 1

    Big problem.When I start my firefox,it consumes over 240M.

    1. Re:Big problem by cratermoon · · Score: 1

      240MB is a problem for you? How much ram do you have, 512MB? OK, you're a bit behind the times -- no worries, you have the right to that. But when systems are shipping with 8GB and 4 cores running over 3Ghz, the choices the FF team has made for user experience over memory usage make more sense.

    2. Re:Big problem by BreezeC · · Score: 1

      I make some test,If I don't use any add-ons,firefox will consume litte than 100M.
      I use 24 add-ons in my firefox.

  52. Firefox 4? by Anonymous Coward · · Score: 0

    "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."

    Firefox 4? What about Firefox 3? And Firefox 2? It's had major memory problems for years. If it weren't for the extensibility, I would have given up on it long ago.

  53. Re:Memory problem? by hawguy · · Score: 1

    What reason could you possibly have for keeping 20 tabs open for 2 days?

    I don't have the same 20 tabs open today that I had open yesterday -- only 4 are pinned as app tabs and open continuously.

  54. What you get when you code in a mix of C and Java by loufoque · · Score: 1

    This was to be expected, the way they handle memory is completely broken.
    They're in C++, they should use RAII and exceptions.

    Instead they code like in C (with returns everywhere and no mean to clean up everything) but with a Java-like OO model that relies on garbage collection.

  55. 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!
  56. A good start. by geminidomino · · Score: 1

    Good luck to the MemShrink team. They've been needed for years.

    Now, Mr. Mozilla, about that UnfuckUI proposal...

  57. This has been a longstanding prob... by Eggplant62 · · Score: 1

    And not just 4, either. Firefox has leaked memory badly. I've a habit of opening many tabs at once, and I expect once I close a page I should see that memory freed at some point. I shouldn't think that's a hard thing to do. a friend and I first observed this back with the 2.0 releases.

    1. Re:This has been a longstanding prob... by cratermoon · · Score: 1

      FF does not leak memory -- not in the strictest since -- as bad as most programs of its size and complexity.

      What it *does* do is hold onto memory it thinks it might need in the future, to reload/re-render something the user looked at recently.

      Of course, explaining to the average user the difference between the technical definition of a leak and simply holding on to useable (but reachable and potentially free-able) memory more aggressively than needed is a pointless exercise. Non-technical users don't care why they are low on memory, they just see that their 100 tabs and 55 running programs all slow down.

      Up to now users of FF have demanded a snappy user experience with instant response time for most interactions. The natural tradeoff to achieve that is to use and hold more memory.

      For whatever reason -- be it an increase in use of low-end hardware or perception that of all the memory-sucking applications a user want, the browser should not be one of them -- people have shifted towards feeling that FF is a memory hog. When you have 8GB or RAM and a multi-core CPU, FF doesn't really look terrible. When users decide that 2GB and 2Ghz is plenty, then FF looks bad.

      I'm glad that the mozilla team has decided to revisit some of the assumptions about performance vs. memory use that have driven development over the past years, but the idea that closing a page should free memory wasn't high on the wish list of most users, who really preferred to see their web pages, bloated with javascript, ads, and and widgets served up by the typical site, load and render quickly.

    2. Re:This has been a longstanding prob... by Arlet · · Score: 1

      Why not use the file system for storing stuff that might be needed in the future, such as recently visited pages ? At least then the OS can decide to use the memory for something else, without having to use swap space.

    3. Re:This has been a longstanding prob... by cratermoon · · Score: 1

      Maybe. I wouldn't assert that, for example, reading in a large decoded & uncompressed bitmap from disk is faster than re-running the decode from an in-memory copy of the original jpeg.

    4. Re:This has been a longstanding prob... by Arlet · · Score: 1

      Or you could store the jpeg on disk, and rerun the decode, which saves a lot of space, and is still acceptably fast. If you're lucky, the jpeg may still be available in memory. If not, the memory is probably in use for something more important, which is usually a good thing.

  58. A consistent problem by Anonymous Coward · · Score: 0

    Memory usage has been a consistent problem with Firefox since around version 1.1.

    I don't understand what's so hard about good memory management practices.

  59. Try this by Anonymous Coward · · Score: 0

    http://adityasharma.net/2010/02/fix-the-firefox-memory-hog/

    FF was a big memory hog, causing the whole computer way slow with the beach ball showing all the time. Then I found that page and did what it suggest. Things a much better now and I hardly ever see the beach ball anymore.

  60. Comparative Memory Usage by Anonymous Coward · · Score: 0

    As a tab hoarder, I've been quite impressed with Firefox 4's memory handling. With 68 tabs currently open, I'm using under 600MB of memory. Chrome hasn't convinced me that discreet tab processes are the way to go for the browsing (at least with my usage habits). I've reached a system grinding 3Gb utilization with less than 30 tabs for comparison.

    1. Re:Comparative Memory Usage by ewanm89 · · Score: 1

      yeah, I have 8GB to use, but even on that I'm tending to prefer firefox 4 over chrome. Also, don't you hate how chrome bunches them up past the favicon so one doesn't know what they are?

  61. Light K-Meleon by luk3Z · · Score: 0

    My K-Meleon uses 50% less memory :)

    --
    Recipes for USA bankrupt - http://tinypaste.com/0d66f dd = dollar deluge (printed in the infinity)
  62. Really? by ewanm89 · · Score: 1

    Once one has more than a small number of tabs, firefox 4 is much better than chrome on my systems.

  63. Re:Considering the price of memory, why even bothe by Ash-Fox · · Score: 1

    FF had memory issues a DECADE ago.

    Decade: 10 years
    Initial Firefox release: November 9, 2004
    This year: 2011
    2011 - 2004 = 7
    7 != 10

    --
    Change is certain; progress is not obligatory.
  64. Re:Perception or just a symptom? by thegarbz · · Score: 1

    The problem with Firefox isn't the perception of using large RAM, it's that it is flat out slow. Sure it renders pages faster than IE but it seem to take the longest to open up even when still cached in RAM. In terms of speed IE and Chrome both beat it from pushing the button to displaying the same homepage.

    Incidentally it also uses a bucket load of RAM. On my system it's not as bad as IE but it's better than Chrome. Is this part of the perception or a symptom of a larger problem that is flat out bloated code.

    The perception that more RAM worse is true not because more RAM is worse, but because the applications that use more RAM are usually worse. There are plenty of examples such as image editing programs. Nikon Capture uses 900MB (300MB more than Lightroom) takes longer to start up, and is way slower to actually apply updated settings to images, so much slow that the speed made me seek out Lightroom as an alternative. Again is RAM usage a symptom of poorly written software or is there a legitimate reason to use this much?

  65. Hell Freezing Over??? by Anonymous Coward · · Score: 0

    Damn, I checked outside and it is still 49 Celsius...

    This must be my oldest complaint about Netscape. They wrote C++ code and because it is hard to tell when an object is not used anymore, they conveniently omitted ever freeing anything.

  66. 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.

    1. Re:Fix goddamn xulrunner/flash please! by maxwell+demon · · Score: 1

      In a sense, xulrunner is Firefox.
      Of course, they are not responsible for Flash; that's Adobe.

      And BTW, I've found Firefox running orders of magnitude more stable since I religiously avoid displaying PDFs inline.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  67. 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.

  68. They are going to fix the memory leak? by Anonymous Coward · · Score: 0

    Excellent! I have been waiting for this since 1994!

    1. Re:They are going to fix the memory leak? by Anonymous Coward · · Score: 0

      Excellent! I have been waiting for this since 1994!

      But, I fear the captcha: "swivel" had the true answer to my question.

  69. Dive in a little deeper by Anonymous Coward · · Score: 0
  70. To anyone who can replicate Firefox memory issues: by c627627 · · Score: 1

    Does this resolve your problem: 1. Type about:config in the address bar of Firefox 4 2. Scroll down to image.mem.min_discard_timeout_ms 3. Simply change the default value from 120000 to 10000 http://www.overclockers.com/forums/showthread.php?p=6882338

  71. Re:What you get when you code in a mix of C and Ja by Malc · · Score: 1

    There was probably a time (a decade ago?) when they were coding for the lowest common C++ compiler denominator, which was a bit of a problem with all of the platforms they target. I have a feeling that this was a reason at one time why they didn't use some features of C++. Is this still a problem? Even Microsoft have come a long way with their ANSI compliance in this time, but what about weird proprietary compilers on some minor version of UNIX? I remember being shocked by the crapness of Sun's compiler for instance compared with even MSDev95 or or Visual Studio 6!!! Yes I know, sounds like a tall order :)

  72. Bloated Addons by Jessrond · · Score: 1

    With all the addons and "skins" that people love about Firefox so much, they'll never get it to be a slim efficient browser. I was once a Firefox Zealot, converting people left and right, but I've learned my ways. The worst was their "Alt Download" "feature" where if you tried to Alt Tab within a second or two of clicking a link, it downloaded a file. So I had hundreds of "forum.cfm" files on several computers.

  73. Re:Memory problem? by Anonymous Coward · · Score: 0

    What find of maniac cunt[...]

    Your mom.

  74. This has always ... by Jaro · · Score: 1

    ... been this biggest problem with Firefox, not just since Firefox 4. Basically the last usable versions (memory/speed wise) where Phoenix and Firebird in pre-Firefox days. Ever since then it has been a memory hog and a pain. Eventually I switched to Chrome which just feels faster and I only use Firefox to debug websites with Firebug.

  75. FF5 by Anonymous Coward · · Score: 0

    I am already on FF5 Beta as FF4 was way worse than I had expected. Currently, my experience with FF5 Beta is much better than FF4

  76. Re:Perception or just a symptom? by qubezz · · Score: 0

    On my system it's not as bad as IE but it's better than Chrome.

    wat? This statement is not as good as gibberish but it's still worse than gobbledygook.

  77. 1000x too much by Anonymous Coward · · Score: 0

    Loading a large static html file should not take 1000x file size in ram.

  78. Re:To anyone who can replicate Firefox memory issu by surveyork · · Score: 1

    Sorry I can't help more, but it seems that bug 660577 could be relevant to your problem: https://bugzilla.mozilla.org/show_bug.cgi?id=660577 (Image-heavy sites are slow and often abort due to OOM; regression from 3.6). Cutting down from 120 secs to 10 secs alleviates the problem... sometimes, depending on how much RAM you have.

    --
    2019 is going to be the year of Linux on the desktop.
  79. MemShrink is welcome but more work is needed by UBfusion · · Score: 1

    There's no way I am going to start an "Internet adventure", meaning searching for news/stuff that require visiting sites that I have never visited before, without a full set of FF4 portable, AdBlock, Noscript, Ghostery Autopager, YetAnotherSmoothScrolling, Stylish and Hyperwords. This for me is the minimal gear for a safe and effective quest. As long as I can't do this with any other browser, FF remains my only choice.

    Needless to say, for all daily uses involving well-known safe sites, I don't need all that armour and I often use lightweight browsers like K-Meleon portable with its brilliant Privacy/Proxy/Agent settings accessible on the menu, or the chrome-based SRWare Iron portable.

    When the MemShrink team succeeds to tame memory use, it will work only for a clean FF. The addition of the above plugins will still make it a beast. So I will SFTU and wisely suffer the consequences of my choice.

    Regarding MemShrink, I think the decision was made by realizing that we are experiencing the age of netbooks and tablets. On these devices with meager hardware capabilities and limited RAM, competitive snappiness requires either more memory usage, which leads to more disk I/O, or more CPU usage, which both reduce battery autonomy. Currently, Chrome-based browsers seem to be more adaptable to these device platforms. MemShrink might provide some solutions allowing to temporarily survive the competition, but my bet is that soon Mozilla will be forced to consider a new codebase, written from scratch and specifically targeting these devices and possibly mobile phones too.

  80. use a remote vm by cheekyboy · · Score: 1

    Then you should be using a VM on your desktop, with 16gig ram, and another instance of FF there, and you can just remote desktop/vnc to it.

    Then it doesnt matter how much ram your laptop has.

    --
    Liberty freedom are no1, not dicks in suits.
    1. Re:use a remote vm by Anonymous Coward · · Score: 0

      You have fucking got to be trolling. A VM just to use a browser properly? Any other software would be derided for the piece of shit it would be, but Firefox gets excuses and workarounds.

  81. Re:What you get when you code in a mix of C and Ja by maxwell+demon · · Score: 1

    RAII worked in C++ even since pre-standard times. Indeed, all you need for it are constructors and destructors, which are quite fundamental parts of C++.

    Exceptions were more of a problem, but you don't need those for RAII; managing resources with RAII works equally well also with return (or any other form of flow control and error reporting, with the exception of longjmp).

    --
    The Tao of math: The numbers you can count are not the real numbers.
  82. FF va IE by Anonymous Coward · · Score: 0

    Something is seriously wrong when IE takes up less memory & resources than FF...and that's all I have to say about that...

  83. According to Sysinternals... by kantos · · Score: 1

    Firefox is using:

    Image (executables): 95,084K

    Mapped File: 56,892K

    Sharable Pages: 133,100k

    Heap: 25,100K

    Stack: 46,080K

    Private Data (explicit mallocs): 205,280K

    Page Table: 1,372K

    Unusable (leftover area of explicitly allocated pages that were LESS than 64K): 9,440K

    Only 10M unusable isn't bad on windows... (start inevitable trolling here) as the memory manager only allocates pages in increments on 64k

    --
    Any and all content posted above may be ignored, considered irrelevant, or otherwise dismissed.
  84. Wow by Anonymous Coward · · Score: 0

    Duke Nukem Forever is released and Mozilla admits that Firefox has memory leaks.

  85. Nice they finally noticed by badger.foo · · Score: 1
    firefox developers could do a lot worse than reading the openbsd-misc thread that starts with http://marc.info/?l=openbsd-misc&m=130683944229077&w=2 and take some of it to heart.

    In the meantime I'd love any pointers at all to where you can buy the systems they used for development and testing - apparently you can actually buy systems with infinite memory so you can do extensive testing and never notice firefox has a memory management problem.

    Number of firefox crashes while typing this comment: four.

    --
    -- That grumpy BSD guy - http://bsdly.blogspot.com/
  86. What standards are we really comparing against? by MasterPatricko · · Score: 1

    On my 2GB RAM linux machine, with 7 tabs open, Firefox having been open for about 6 hours, about:memory says

    Memory mapped: 287,309,824
    Memory in use: 237,087,826

    Is that really unreasonable? Every other web browser I've tried gives similar numbers. Or are people just comparing to some ideal standard of 15 years ago where everything is supposed to run in 500kB?

    --
    I'd tell a UDP joke, but you may not get it. I'd tell a TCP joke, but I'd have to keep repeating it until you got it.
  87. Mac OS 1 Memory Manager by tepples · · Score: 1

    Mac OS (classic) had working soft references back in 1984.

    1. Re:Mac OS 1 Memory Manager by bill_mcgonigle · · Score: 1

      Any idea what they called it? I'm not getting hits for "inside macintosh" "soft references" except some patents that reference the memory manager document (which I have on a CD somewhere...)

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    2. Re:Mac OS 1 Memory Manager by tepples · · Score: 1

      The model used by Mac OS hadn't yet been given the name "soft reference". Try "inside macintosh" "memory manager" or "inside macintosh" newhandle or "inside macintosh" purgeable.

    3. Re:Mac OS 1 Memory Manager by toby · · Score: 1

      It was a feature of the Resource Manager, but I don't think it was heavily used, as single-floppy-128K systems were quickly superseded and upgraded for serious use.

      --
      you had me at #!
    4. Re:Mac OS 1 Memory Manager by Anonymous Coward · · Score: 0

      It was a feature of the Resource Manager, but I don't think it was heavily used, as single-floppy-128K systems were quickly superseded and upgraded for serious use.

      They were superseded, but that does not imply the RM or handle-based memory management went away. The system was designed around them, and they were still present right up till 'classic' MacOS was obsoleted and replaced by OS X.

      Besides, as soon as there were 512K Macs, there were programs pushing the limits of those, and as soon as there were 1MB Macs, there were yet larger programs, and so forth. The benefits of soft references didn't go away just because the machines got larger.

  88. Win32 ignores GMEM_DISCARDABLE by tepples · · Score: 1

    What way exists that 1. actually works as documented in *BSD, Linux, Mac OS X, Windows 32-bit, and Windows 64-bit, and 2. can be reasonably abstracted across said operating systems? One example of violation of requirement #1: Win32 ignores GMEM_DISCARDABLE.

    1. Re:Win32 ignores GMEM_DISCARDABLE by maxwell+demon · · Score: 1

      Someone above mentioned VirtualAlloc with MEM_RESET for Windows. I don't know if it has the right semantics, though.

      But if it only works on some operating systems, then just use it on those operating systems. It's better to be a memory hog only on operating systems which don't provide the necessary support, than to be a memory hog everywhere. After all, the behaviour on other operating systems will be just the same behaviour as the current one, so it's not making things worse. But on operating systems supporting it, it will make things better.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  89. Realtime at home by tepples · · Score: 1

    In the real world, we don't need hard realtime guarantees in the vast majority of situations.

    But such realtime situations arise often enough even in home use (video playback, video recording, games) that we do need at least some mechanism for realtime guarantees in desktop PC and handheld operating systems.

  90. Recently Closed Tabs and Recently Closed Windows by tepples · · Score: 1

    435mb currently. One tab open to slashdot

    Try the back button. Try History > Recently Closed Tabs. Try History > Recently Closed Windows. I haven't found any easy way to clear out the Recently Closed lists except to restart Firefox.

  91. Firefox Developer Top 20 Excuses by Futurepower(R) · · Score: 1

    Mozilla Foundation Top 20 Excuses for Not Fixing Firefox Bugs

    Originally posted 2006-09-08.

    Slashdot no longer numbers HTML numbered lists.

  92. Haven't I heard this before? by BitZtream · · Score: 1

    Seems like this is a recurring theme at Mozilla that 'makes great bounds' but never actually gets things down to a sane level.

    --
    Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
  93. Having already maxed the RAM slots by tepples · · Score: 1

    Seriously, there's no reason NOT to have a lot of RAM right now.

    Other than having already maxed the RAM slots on an older or Atom-based motherboard. Or what 10" laptop with "a lot of RAM" do you recommend?

    with 4GB, a bare minimum these days for gamers

    My gaming machine has 4 KB. (I can explain if you wish.)