Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Funniest thing is that FF memory usage didn't go down that much. For me it is even higher.


I'm currently at a little over 1 GB with 8 tabs open.

I really wish I had the option to trade off responsiveness for memory usage by being able to mark tabs as "no background activity allowed" so FF could serialize that content to disk when the tab isn't in focus.


The main reason tabs aren't saved to disk isn't a concern about responsiveness, it is a concern about data loss. You have to be very sure that you restore the state exactly. What if you spent a few hours filling out some government form online, then you went and took a break by watching a few YouTube videos? Memory usage might spike up, and the browser decides to unload the tab with the form. You'd be mad if form state got lost when you switched back.

I've heard that some people set Firefox to not autorestore tabs on load, and then periodically close and reopen Firefox, so their background tabs aren't loaded. Pretty clumsy, but I guess it gets the job done. I don't know if there's any addons that do something similar.


>> by being able to mark tabs as "no background activity allowed"

> What if you spent a few hours filling out some government form online, then you went and took a break by watching a few YouTube videos? Memory usage might spike up, and the browser decides to unload the tab with the form. You'd be mad if form state got lost when you switched back.

GP is talking about actively marking tabs as "no background activity allowed".

I have been searching in vain for something like that: stop scripts in background tabs except for specifically whitelisted pages.

There is absolutely no reason that I can see why every website and their ads should be allowed to roam around freely in the background.

There is however a number of reason why they should not be allowed. Battery life and phishing attempts readily comes to mind.

I guess whoever comes up with a well-working extension for that can easily ask me for USD 30 or even 40 and expect me to be a walking billboard for it ;-)


> I have been searching in vain for something like that: stop scripts in background tabs except for specifically whitelisted pages.

Have you tried UnloadTab?

https://addons.mozilla.org/en-US/firefox/addon/unloadtab/


Ok. Will try. I think I see an issue here where I want to go back to a tab I have open on the train home.

If it is unloaded that means I have to connect to the Internet again to get hold of my page again?

(I'd think what I want is just to pause any javascript or other processing from any webpage that us not focused in the browser and not specifically whitelisted.)


Background tabs already have their timers run less frequently. In Firefox, that was added in 2011 [1]. Certainly further improvements to reduce background tab activity would be nice. One way you can sort of get that effect is to use Reader Mode, on pages where that works.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=633421


Or you can buy 2GB of RAM with those $30


We've reached a point where a lot of consumer hardware simply can't be upgraded. The ideal of just adding more RAM isn't possible (or perhaps practical in many cases). MBPs can't be upgraded at all these days. My Lenovo laptop can, but going 16 GB -> 32 GB requires far more than $30 since I'd need to buy 16 GB SODIMMs.

That's also a bit beside the point. I have a workstation with 48 GB RAM. I left a browser running in the background and had one tab consume 20 GB on its own before I killed it. Many of these leaks seem to just be unbounded memory growth, so that hypothetical 2 GB you add is going to be eaten up in short order anyway.


The scenario you describe with one tab using 20Gb is "beside the point" and certainly an exceptional situation. I've never seen that happen... I think I've had one Firefox crash this year, and that time it wasn't using all the RAM - it was hogging 100% CPU instead.

Of course the extra 2Gb might help for someone with less than 48Gb in their machine (most of us!).


Well, my point more was apps/sites that go sideways will eat as much RAM as they're allowed to. The 20 GB case was only special in that the leak rate was much higher than most. On a smaller scale, whenever my laptop fan kicked on, I knew I left a Travis tab open in the background somewhere. That was the CPU going into an aggressive GC loop due to the relatively huge amount of memory being used (2 - 4 GB).

But my original point is really that dismissing gross memory usage by saying you can buy more RAM for cheap is no longer accurate. In many cases, your machine's configuration is unchangeable. Getting an extra 2 GB RAM isn't $30, it's the cost of a brand new device. In other cases, where you might have configurable hardware, you often have to buy the largest capacity chip available and the economics get skewed. For SODIMMS, going 8 GB -> 16 GB is reasonably cheap, 16 GB -> 32 GB is fairly expensive.

I'd argue having to do a hardware upgrade for a web app in the first place is a bit silly. There's often very little reason for these apps to be so large in the first place.


It's not the RAM for me (I have 16GB).

It is about things like harrassing my CPU multiple times a minute after my search results have loaded (looking angrily at you googlers, google was the worst offender here it seems! (Windows 10, FF))


More memory doesn't help. I have 64gb and still need to close ff every few days. (Granted I do keep 50-100 tabs open at all times).


FF mobile does this and it drives me nuts. I'll be on 4chan, watch a YT clip, then tab back and FF reloads the original HTML. Apart from being slow (takes a few seconds to rerender it all), it also loses AJAX-loaded data.

My phone reports it has 600MB of RAM free, so I dunno what's causing FF's behaviour here nor how to disable it. I can't always reproduce it, but it happens enough that every browsing session has some sort of frustration.


All the mobile browsers I've tried do this - Firefox, Dolphin, and stock Android. I distinctly remember browsing the web quite happily with Firefox desktop on a machine with 512 MB of RAM as recently as 2008, so I can't help but feel we've gone backwards.


Am I the only one who loves this behavior? I'd be perfectly happy forcing Chrome/Firefox/etc. into a 1GB sandbox and then telling it to "unload tabs on memory pressure." I only use a few tabs at a time; a simple LRU OOM-eviction algorithm should work wonders.


Maybe you're the only one. I hate waiting for a tab to reload from the network unnecessarily, especially on mobile!


"From the network" isn't actually a part of the semantics of this behavior, though. If the page's browser-side cache is still valid according to its original response headers, the browser will just reload the page from cache rather than hitting the network.


Android or iOS? I have no such complaint on Android - I usually load the pages that interest me in separate tabs and then read them offline.


Android. I can do that, but when I return to those tabs, they will reload from a cached version.


If the feature existed and it didn't properly restore form content when I switched back to the tab then I'd call that a bug. :-D


This is the default. If you set it to restore from your previous session on startup (or if it restores your session after a crash, or you choose History->Restore Previous Session), then it will only load tabs when you switch to them.


How about detecting the pages that don't have stateful elements, and then only serializing those?


With applications written in javascript ? Stateful on the client side alone or stateful on both sides ? It wont be safe to assume that state is persisted transparently on the server side. May be they just cache it for a while.

To make this work reliably would be quite difficult.


You could be really conservative: only assume statelessness if the page has no <form> elements and has no calls to the XMLHTTPRequest API (or window.eval).

Or you could be really conservative: only assume statelessness for pages without forms and without any Javascript. (These do exist!)


> These do exist

We have seen things people wouldn't believe. Webpages without any Javascript. Webpages using correct http responses. Watched C-beams glitter in the dark near the Tannhauser Gate. All those moments will be lost in time, here come the transpilers


There are several addons that do this. I think Suspend Tab is the most popular. https://addons.mozilla.org/en-US/firefox/addon/suspend-tab/



I use the same on Chrome, nice memory saver.


Thanks! I'll check that out.


For a reference point on scaling, on a Windows 7 machine that hasn't been shutdown in a week or two, I have a long-running Firefox session with 5 windows and 80-something tabs, and I'm at 1.7 GB. Half a GB of that is being consumed by the Google Music player.


I've noticed Google Play Music is heavy. It can easily consume half a GB or more on my machine. I think at this point the browsers are doing the best job they can but it's pretty telling that it's the web apps/sites we use that cost us memory.


Google Play Music uses Flash in Firefox (but not in Chrome), so part of the memory usage is out of Mozilla's control.


I'm at 2.9G virtual 1.277g resident with about 130 tabs open (yeah, I'm a goofball but I like my tabs). It's pretty responsive on a thinkpad x220 i5-2540M @ 2.6ghz, 8G of ram and an SSD.


Not even criticizing, but how do you manage 130 tabs? How do you find tabs you're looking for? You must have some kind of system!


A few people use Tree-Style Tabs, which organize them as a tree structure, similar to directories. It encourages using tabs instead of bookmarks, which have a terrible UX (in all browsers, not picking on Firefox here).

https://addons.mozilla.org/en-US/firefox/addon/tree-style-ta...


Tree Style Tabs is the primary reason why I stick with Firefox. Without it, I wouldn't even know where to begin managing the relevant sites/info I encounter when reading up on diverging lines-of-thought.

For me, it is /the/ absolute killer feature for browsers.

---Alex


I do that and I regularly hit 1000 tabs. Once a week I close and reopen or it gets too slow.


I do that and I hit 1000 tabs. Once a week I close and reopen or it gets too slow.


Not sure how he does it, but I don't manage those. I just don't close tabs (I usually forget to do it :), so after week or two I end up with 200-300 tabs (my record is 900).

I tried to use chrome once and it ate all my ram, and they were saying it uses less ram then firefox back then.


You can use the Awesome Bar to search open tabs: just prefix your query with '%'.

More search tips can be found here: https://support.mozilla.org/en-US/kb/awesome-bar-search-fire...



Firefox lets you search your open tabs (urls/titles/etc). The simplest way to find the tab you're looking for is to do just that: search.


That's interesting because for me the Windows task manger reports 377MB with 10 tabs open, some of them are news sites that tends to be "heavy".

edit: oh, I'm using ad blocking add-on and maybe you don't, that could be one reason, besides different websites another reason could be that you have the browser open longer than me.


I've 25 tabs open and Firefox is reporting 250MB of Private Use memory use in Task Manager. I do have an adblocker though.

> so FF could serialize that content to disk when the tab isn't in focus

Isn't there an extension (Suspend Tab?) which does this?


Even in an iOS fashion, in the way backgrounded apps work. I don't need tabs consuming memory in the background, and if I did I could white list it as able to run in the background.


I'm curious - what's the benefit of doing this sort of thing at the application level, rather than letting the OS's virtual memory system handle it as usual?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: