[HN Gopher] Tab Unloading in Firefox 93
       ___________________________________________________________________
        
       Tab Unloading in Firefox 93
        
       Author : mthermidor
       Score  : 281 points
       Date   : 2021-10-05 17:02 UTC (5 hours ago)
        
 (HTM) web link (hacks.mozilla.org)
 (TXT) w3m dump (hacks.mozilla.org)
        
       | MayeulC wrote:
       | > On Windows, Firefox gets a notification from the operating
       | system (setup using CreateMemoryResourceNotification) indicating
       | that the available physical memory is running low.
       | 
       | I've longed for such a mechanism in Linux, but I don't think it
       | exists. This should at least be an OS-level signal IMO, though a
       | D-Bus interface could also work. Integrating with one of the
       | recent userspace OOM daemons could be a good idea.
        
         | favorited wrote:
         | IIRC on Linux, it overcommits when allocating, so you can keep
         | mallocing memory beyond capacity and it won't actually fail
         | until you go to use that memory.
        
           | marcosdumay wrote:
           | The GP is describing a signal that your application can react
           | to, not a behavior of allocation failure.
           | 
           | Linux could use some improvement on both. The idea that you
           | always have enough swap and can send everything not used
           | there is wrong. Applications know better how they behave a
           | low-memory than the kernel.
        
         | gsvelto wrote:
         | Recent Linux kernels allow you to measure memory consumption
         | from a QoS point-of-view via pressure stall information:
         | https://www.kernel.org/doc/html/latest/accounting/psi.html
         | 
         | This isn't the same thing as detecting how much memory is
         | available because Linux overcommits by default. PSI will tell
         | you when the kernel is swapping too much (depending on the
         | thresholds you set) and from that you can infer the user is
         | running low on memory.
         | 
         | Android's lowmemkiller had an explicit free memory threshold
         | userspace could set to be notified. Starting with Android 11
         | however it's now using PSI too IIRC.
        
       | Mic92 wrote:
       | Shameless self-plug: https://github.com/Mic92/chrome-tab-gc (I
       | just ported it from chrome to firefox)
        
       | whatever1 wrote:
       | Kudos to the devs who fixed it. In my c++ project I was trying
       | for weeks to figure out how to release back to the OS the memory
       | that my std::vector was occupying, only to find out that there is
       | no straight forward way of achieving so.
        
         | gsvelto wrote:
         | Detecting low memory scenarios is surprisingly hard on desktop
         | operating systems, but trivially simple on Android/iOS. Firefox
         | for Android already made extensive use of this feature while
         | desktop Firefox' available memory watcher underwent a lot of
         | changes over the years before becoming fairly reliable.
        
         | shultays wrote:
         | Small allocations are allocated using sbrk and never truly
         | freed. Larger ones use mmap which gets freed.
         | 
         | Guess the solution would be either preallocating/reserving
         | everything, or maybe using custom allocators that works with
         | bigger chunks
        
         | keithalewis wrote:
         | Right curly brace '}'
        
           | whatever1 wrote:
           | I wish it was that easy. Destructing of your vectors does not
           | guarantee that the memory will be released back to the OS,
           | and it is not, if your OS is desktop Linux.
           | 
           | See an example here:
           | https://stackoverflow.com/questions/26020580/huge-
           | stdvectors...
        
       | swang wrote:
       | What I want implemented.. Chrome/Firefox whatever... is that
       | instead of unloading and reloading when I go back to the tab I
       | want it to export basically an HTML file and when I click back to
       | that tab, I want it to reload the HTML file instead with some
       | notification/marker that it is a "cached" version. There are
       | times where I'll leave a tab in the background that I don't want
       | refreshed but when it gets unloaded, poof, I lose the original
       | data from that page.
       | 
       | I know about Chrome and its ability to prevent discards, but I
       | want this to be the default or at least a toggle option. I don't
       | mind the unloading of the tab, I just get annoyed when it
       | reloads.
        
         | gildas wrote:
         | SingleFile [1] is supposed to be able to do that (more or less)
         | by enabling these settings in the options page:
         | 
         | - User Interface > open saved page in a new tab
         | 
         | - User Interface > auto-close the tab after the page is saved
         | 
         | - Auto-save > auto-save on tab discard
         | 
         | Then you have to select in the context menu of the extension:
         | Auto-save > Auto-save all tabs (or Auto-save unpinned tabs)
         | 
         | [1] https://github.com/gildas-lormeau/SingleFile
        
         | bogidon wrote:
         | I was surprised recently to learn about the back/forward cache
         | (bfcache) [1], a common browser optimization that sort of does
         | what you're describing but stores a more complete snapshot of
         | the page, including the JS heap. I'm not sure if it's used in
         | this new FF feature (the article doesn't give details about the
         | mechanism of unloading).
         | 
         | However the bfcache unsurprisingly causes edge cases in JS-
         | heavy pages/SPAs, and a prevailing solution [2] is for the page
         | to force a reload when it is restored from this cache rather
         | than explicitly handling those edge cases, nullifying the
         | optimization.
         | 
         | [1] https://web.dev/bfcache/
         | 
         | [2] https://stackoverflow.com/a/13123626/14665201
        
           | Waterluvian wrote:
           | Only recently when I flew backwards through about 50 history
           | steps (entirely different webpages) on my phone did I think
           | more deeply about how impressive it was that it was so
           | seamless.
        
           | Arcsech wrote:
           | Yet another instance of SPAs pointlessly reinventing problems
           | we solved decades ago.
        
         | hoten wrote:
         | It'd have to be more than just the HTML, it'd need to be
         | everything the page used. Basically, all the data you'd get by
         | clicking the "download HAR" button in the DevTools Network
         | panel. Including some special sauce on top to replay any XHRs
         | (assuming you want to get to the last state by replaying...
         | otherwise the JS page state would need to serialized some how)
        
           | jandrese wrote:
           | Couldn't the browser just dump the current DOM and JS state
           | onto a disk? Treat it like a computer hibernating.
        
         | ct0 wrote:
         | This is my pet peeve. Most of the time I notice this when im
         | interested in a reddit thread that's deleted and I lose the
         | ability to review it.
        
           | lucb1e wrote:
           | This, plus any sort of live data (think stock market, tweet
           | feed, etc.), plus any sort of form input (input fields should
           | survive since like Firefox 3.5, but then people discovered
           | you could also dynamically build forms with Javascript and
           | the rest is history).
        
         | karlding wrote:
         | Chromium has "Paint Preview" (aka "Freeze-Dried Tabs") [0]
         | which does something similar. Basically it consists of a
         | capture (Skia Picture and links in a proto), compositing the
         | capture into bitmap tiles, and then playback to play the page
         | using the native UI.
         | 
         | I think it's only supported on Chrome for Android right now.
         | 
         | [0]
         | https://chromium.googlesource.com/chromium/src/+/refs/heads/...
        
         | spython wrote:
         | Sounds like you want WebMemex, specifically the freeze-dry
         | functionality: https://github.com/WebMemex
        
         | capitainenemo wrote:
         | I know this doesn't help with the cache part, but if you pin a
         | tab, it used to prevent it from getting unloaded. Might help if
         | a particular tab is important to you and they still honour
         | that.
        
         | SilasX wrote:
         | This! I feel like Back used to get instant results all the
         | time, and now it's almost always a big delay, which is a huge
         | pain -- plus, it loses your position on infiniscroll and other
         | dark patterns.
         | 
         | Part of it is caused by site coding, but part of it is browsers
         | treating "back" as some species of new page
         | load/arrival/selection.
         | 
         | And I know it's possible to get us back to the old days! The
         | functionality I want is almost exactly what I would (already)
         | get if I just opened every link in a new tab and switched back
         | instead of triggering the back button.
         | 
         | (Which, incidentally, is what many sites recommend doing now
         | for that very reason -- at least reddit.)
        
           | vbezhenar wrote:
           | AFAIK whether page will be restored or reloaded depends on
           | its cache headers. I remember breaking back button in one of
           | my projects, because users asked for it, as they expected
           | fresh data for some reason. It was not SPA, just old server
           | rendered website, so I disabled caching via response headers
           | and it worked.
        
             | SilasX wrote:
             | Hm I'm going to see if there's a setting to override a
             | site's choice of that header.
        
           | NoGravitas wrote:
           | Back basically works like it always did on static sites.
           | Blame the fashion for single-page apps and endless scrolling
           | for it being broken.
        
         | sails wrote:
         | Would love to know if this is practically possible. I use Auto
         | tab discard [] to save memory, but I'd much prefer the ability
         | to retrieve an html file than having to reload the page. A
         | simple way to save that html file of current view when
         | bookmarking a page would also be a useful addition in a similar
         | vein.
         | 
         | [] https://addons.mozilla.org/en-GB/firefox/addon/auto-tab-
         | disc...
        
           | graindcafe wrote:
           | Doesn't OS swap covers much of your need ?
        
             | bmicraft wrote:
             | Not when the need is to increase battery life (reduce cpu
             | usage). Having a couple of youtube/reddit tabs open in the
             | background can really impact battery life I've found.
        
         | remram wrote:
         | My number one annoyance (with Firefox and Auto-Discard
         | extension) is when I open back my tab and get a redirection to
         | some login page. Login, get sent to homepage. Back button sends
         | me to login page. No way to get back to the actual tab I'd left
         | there...
         | 
         | That tab is then lost forever, unless I can find it in the
         | history from whenever I had opened the tab.
        
           | progval wrote:
           | Long-click the back button to get a list of previous pages in
           | the tab.
        
             | remram wrote:
             | It's not there. It's like the redirect replaces the history
             | entry.
        
             | Avery3R wrote:
             | Right click for people with real mice
        
         | kitsunesoba wrote:
         | I can't speak for Gecko or Blink/Chromium, but I don't think
         | this would be difficult to implement in a WebKit browser as
         | long as some limits are involved.
         | 
         | Just save the tab's contents in a webarchive file, then when
         | restoring load that webarchive and inject some JavaScript that
         | makes any kind of interaction aside from scrolling load the
         | page's live counterpart (with a confirmation prompt, perhaps).
         | 
         | This would also come with the advantage of the cached version
         | showing up in browser history for "free", so if you
         | inadvertently go to the live page undoing it is as easy as
         | hitting the back button, and if you decide you want to preserve
         | the cached state indefinitely all the browser has to do is copy
         | the webarchive file out of temporary storage to wherever the
         | user indicates.
        
           | freediver wrote:
           | Can you contact me? Would like to explore implementing this
           | idea in Orion with you.
        
         | jklinger410 wrote:
         | Yeah it would be cool if it saved the state of the page until
         | you manually refreshed it.
        
         | twistedpair wrote:
         | I think this gets to the root of why you're leaving a tab open.
         | You might have non-persisted state in the page, hence you don't
         | want to close it.
        
         | okasaki wrote:
         | One way to fix this is to buy more memory (if possible). Then
         | your tabs will be much less likely to be unloaded.
        
         | mdoms wrote:
         | This is precisely what Edge does on Android, not sure if it's
         | the same behaviour in Chrome on Android.
        
       | ihsw wrote:
       | It'd be great if this was tunable and usable in non-OOM
       | scenarios.
        
         | Kliment wrote:
         | It is if you add Total Suspender.
        
           | billfor wrote:
           | Total suspender is great not just for memory but for CPU. I
           | reduced a lot of unnecessary CPU consumption by having the
           | tabs not in focus frozen after a few minutes.
        
       | animex wrote:
       | I've never had Firefox crash. I guess they are reaching for those
       | edge cases on power users who keep a billion tabs open. Maybe I'm
       | missing some sort of productivity hack that involves leaving 100+
       | tabs open.
        
         | sbysb wrote:
         | As someone who regularly has >300 tabs I can promise you that
         | it is not because of any productivity gains (if anything the
         | opposite lol)
        
         | Kliment wrote:
         | There's a handful of horrible websites that use enormous
         | amounts of CPU and memory. You don't need too many of those to
         | drag a browser down. I am a thousands-of-tabs user (and yes
         | it's an awesome productivity hack for a number of my workflows,
         | but never mind that) and I don't normally have any problems.
         | Unless I make the mistake of opening some trash website (Slack
         | used to be like that, I've not used Slack in years so I don't
         | know if it still is) and then it bogs down everything.
        
           | hsbauauvhabzb wrote:
           | Slack is still trash.
           | 
           | I segregate browsers by using different Linux users for
           | different tasks (slack, Facebook, general, etc) which works
           | well with my similarly bespoke workflow. The problem with
           | this arrangement is that When Firefox has pending system
           | upgrades it requires all browsers be closed and reopened.
           | 
           | I'm curious about your productivity hack though, I use a grid
           | keyboard layout with ~20 workspaces grouped to four windows
           | for each task/project and one set to emails/fb/slack
        
         | Macha wrote:
         | My peak is in the high 300s of tabs. It works fine, though I
         | imagine if they were 300 instances of youtube or some webgl
         | game or video calls there might have been more issue.
        
         | gostsamo wrote:
         | I'm using a screen reader and FF regularly crashes due to some
         | broken memory management in the accessibility service. If this
         | unloading cleans the memory before it gets critical, I'm all
         | for it.
        
           | cpeterso wrote:
           | Do you have any crash report IDs in your Firefox's
           | _about:crashes_ page? I can check whether a Bugzilla bug
           | report has already been filed for those crashes.
        
             | gostsamo wrote:
             | I think that the issue is known, but hard to track. It
             | shows with NVDA and heavy web apps like Twitter and
             | Messenger if they are running for some time. I'm posting
             | here some of the crash ids, but it is likely that they are
             | not representative. When the browser starts to clock up, it
             | locks the screen reader as well and I'm not waiting for the
             | crash, but kill the process with extreme prejudice. I'd be
             | glad to help in any other way.
             | 
             | bp-cb27fd07-ad27-49bf-b6c2-9dbbb0211005
             | 
             | bp-96eef135-da51-45a8-a792-d28810211005
             | 
             | bp-184a8916-227c-42c4-8308-6e3c00211005
             | 
             | bp-ba6748d3-2d93-4d84-992e-8cf960211005
             | 
             | bp-8bdfb00f-0e30-4cd3-826c-efb910211005
             | 
             | Here is the Bugzilla ticket:
             | https://bugzilla.mozilla.org/show_bug.cgi?id=1572915
        
               | gsvelto wrote:
               | Unfortunately those crashes do not appear to be related
               | to low memory scenarios. They seem to be genuine bugs in
               | the screen reader. I think the right bug tracking them is
               | this one:
               | https://bugzilla.mozilla.org/show_bug.cgi?id=1691928
        
               | gostsamo wrote:
               | As I said, usually I don't wait for a full crash so there
               | is a survival bias in those ids.
        
         | throwaway123x2 wrote:
         | How is that possible, I get FF crashes literally every time I
         | load a moderately intensive website (eg. Google Keep). I still
         | use FF because I can't abide Chrome. My PC is admittedly a bit
         | older (only 6 gigs RAM) but still.
        
           | bmicraft wrote:
           | You should really check if you have bad memory. I've found
           | firefox to be very sensitive to such an issue
        
           | jandrese wrote:
           | 6GB is ample memory if you're not loading tons of tabs. I run
           | Firefox on Raspberry Pi model 1s and while you have to limit
           | yourself to a tab or two and have plenty of patience it does
           | still work.
           | 
           | What doesn't work is trying to compile the browser on the Pi.
           | The build process has some really gigantic source files that
           | cause the compiler to choke.
        
           | sundarurfriend wrote:
           | I've only got 4 gigs of RAM, and don't think I've seen
           | Firefox crash in years. And I run Jupyter notebooks, browser
           | games, image processing, all sorts of intensive things on it.
        
           | loufe wrote:
           | I don't know if I've experienced a crash in Firefox in years.
           | I would really suggest taking a look at the crash logs and
           | maybe do a checkup on your machine's health.
        
           | marcosdumay wrote:
           | Hum... Firefox breaking on some Google site is surprising,
           | but not extremely so.
        
           | techwizrd wrote:
           | I routinely have hundreds of tabs open in Firefox at any
           | given time without crashes on macOS and Linux. The tabs
           | include everything from documentation, Jupyter notebooks,
           | papers, Jira, Reddit, HN, Github, Gitlab, GMail, Google Keep,
           | Todoist, etc. I can't even recall the last time Firefox
           | crashed for me.
        
             | sundarurfriend wrote:
             | Agreed.
             | 
             | I've got 99 problems with Firefox, but a crash ain't one.
        
           | kaba0 wrote:
           | Maybe corrupted firefox profile? Try running it with a new
           | empty one.
        
         | moreira wrote:
         | Firefox runs on systems with 512MB RAM. [1] Can you imagine
         | keeping a Slack tab open on a system like that? Never mind 100
         | tabs.
         | 
         | [1] https://www.mozilla.org/en-US/firefox/93.0/system-
         | requiremen...
        
           | NoGravitas wrote:
           | To be fair, I tried running it recently on a machine that I
           | had artificially limited to one core and 512MB RAM; it was
           | not actually usable, even for static pages. WebKit browsers
           | didn't really do any better, though, which surprised me.
        
             | hsbauauvhabzb wrote:
             | You can't even boot the Ubuntu cli installer.
        
         | grogenaut wrote:
         | It's the same productivity hack as the piles of stuff around my
         | house I'm never going to use.
        
         | davidgerard wrote:
         | I've seen this on my 4GB RAM netbook. This is basically what
         | Chromebooks do when you've got too many tabs open, and it's
         | much better than the system trying to thrash itself to death,
         | which is what it does now.
        
         | earthscienceman wrote:
         | I'm going to reply with a comment stolen from a different HN
         | discussion:
         | 
         | The fact that people (myself included) have 100s of tabs open
         | is a symptom of just how broken bookmarking is on the modern
         | web. Bookmarks are a miserable way to create a placeholder for
         | your thoughts. It's too static, must be maintained, and
         | generally prone to link rot.
         | 
         | I'm a scientist. I open and read 10-20-100 links for a given
         | topic depending on if I'm coding or if I'm writing my own
         | papers. These pages are often _very_ temporary for me, in the
         | sense that maybe I 'm browsing documentation and the exact
         | place in the documentation that I'm visiting changes in time.
         | Or maybe I initially believe a paper will be relevant to future
         | work but I haven't read it and would like to get back to it in
         | some time. I could spend the mental overhead of keeping an
         | organized bookmark system that changes with these workflows day
         | in and day out... or... I could just leave the tabs open. Guess
         | which I choose? I have a laptop with 64Gb of ram for a reason.
         | Although firefox is pretty fantastic these days in terms of
         | resource usage.
        
           | madushan1000 wrote:
           | Checkout toby extension, unfortunately only for chrome.
        
           | parhamn wrote:
           | I'd love to talk to you! I'm making a browser which already
           | has automated ML tagging and full text search of content
           | (should you enable it) so you don't really need bookmarks to
           | do smart search and recall. We also have a really cool and
           | well indexed snippet tool built in for pieces of information
           | you want to keep and share. Id love to learn more about your
           | use cases, if you're interested reach out to parham@synth.app
           | :)
        
             | lifthrasiir wrote:
             | My use case may qualify; I have anywhere from 100 to 1,000+
             | open tabs across three different devices and four browser
             | instances (three Firefoxes, one Chrome) at the peak. But
             | judging from your website it looks like a full browser
             | (presumably built out of Chromium) and not an extension
             | that can be used in any browser, so, ugh.
        
               | parhamn wrote:
               | Fair enough. The browser is built because we think
               | browsers should do a lot more than just tabs and
               | bookmarks, so it wasn't enough to just add an extension
               | (we have many more features that we wanted a well
               | integrated experience around).
               | 
               | With that said, there are very few limitations to the
               | browser at this point and it will be eventually open
               | source so feel free to reach out as well!
        
               | thibran wrote:
               | If you want to be innovative, have a look at the browser
               | history function. There was zero progress, but I don't
               | see a reason why the history should not allow me to
               | browse all currently cached images.
        
           | toomuchtodo wrote:
           | The tabs are the bookmarks, we just need better management of
           | tab contents (ephemeral, short term persist, long term
           | persist, etc).
        
           | stan_rogers wrote:
           | ...or you could simply download what's necessary/interesting
           | and ensure that you've got the data as it was. Because people
           | seem to think that everything needs to be an app, having
           | something open in a tab is no guarantee that it'll be there
           | when you revisit the tab.
        
             | joemi wrote:
             | I can't speak for the person you're replying too, but I
             | have somewhat similar use cases sometimes, and what you
             | propose isn't really a fix. For instance, when programming,
             | the documentation could be spread out amongst many webpages
             | (like each chapter or each section in a chapter is a
             | separate page). And that might not be the only reference
             | I'm using. And then add in separate pages for examples,
             | too. It's not always possible to anticipate all your
             | reference/example needs at the beginning of the project, so
             | downloading everything doesn't always work.
        
               | asdff wrote:
               | If the documentation site is worth its salt it will allow
               | you to download a local html copy or even pdf. I
               | personally haven't seen a documentation site that doesn't
               | let you do this, since its important to store your
               | documentation locally in the event the website goes down
               | (happened to me so its not out of the question).
        
               | joemi wrote:
               | Oh, no doubt that (or just a single webpage view of all
               | the documentation) _should_ be something that all
               | documentation should provide, but I don't think it's any
               | surprise that not everything has good/ideal
               | documentation.
        
               | Y_Y wrote:
               | Often your browser can do this. It's especially easy if
               | you can view the documentation on a single page.
               | Pagination on mostly-text sites is a bizarre habit that's
               | about as necessary as a screensaver.
        
               | asdff wrote:
               | It's especially baffling with the pagination when the
               | source document the website is generated from is a single
               | markdown document on github most of the time. Just give
               | me that. It's a computer, I don't have to thumb through
               | pages like a bound book, i can ctrl f for my topics.
        
           | bitcuration wrote:
           | That and the fact bookmark may ends up in a removed page,
           | orphan link. Essentially people leave tabs open meant to keep
           | a cache of it, maybe subconsciously. Bookmark doesn't do
           | that.
           | 
           | I don't mind maintaining it, so sometimes I use getpocket for
           | that purpose but getpocket is not organized and frankly is
           | not made for this purpose.
        
           | ajsnigrutin wrote:
           | It's more of a symptom, how bloated the modern web is.
           | 
           | 5+ browser windows on 32mb of ram was never an issue back in
           | the win95 time (so, whole os + browser and 5 pages). Now,
           | we've got 8 gb of ram as pretty much minimum on mid range
           | laptops, soon even on phones (flagships have it now), and
           | browsers have become a biggest memory user (outside of newish
           | games) on an average pc.
        
             | moehm wrote:
             | In 1995 there was no tabbing (I think?). I have 5+ browser
             | windows with 100+ tabs open, so more like 500 browser
             | windows, not 5.
        
           | speedybird wrote:
           | Bookmarking, history and unloaded tabs are three disjoint
           | systems that all solve the same problem for me, each
           | inadequate for different reasons. The solution to this mess
           | is to unify the three.
           | 
           | Also two of these three, history and bookmarks, are presently
           | bitrotting badly in firefox. Firefox's 'Library' window that
           | shows History and Bookmarks in separate tabs is abysmally
           | neglected.
        
           | asadkn wrote:
           | Same issue. Except multiple short-term projects with hundreds
           | of reference tabs, in multiple windows, ranging from groups
           | that would classify as "mood boards" to research.
           | 
           | I settled for Workona when it launched about 2+ years ago
           | after trying many extensions else like OneTab, SessionBuddy,
           | Toby and so on.
           | 
           | I might start looking for something else again as Workona is
           | getting a bit more, commercialized, but it's fine for now.
        
           | godshatter wrote:
           | Bookmarking systems are completely outdated, but I'm not sure
           | what they should be replaced with. What would help you in
           | this case so you didn't have to worry about losing the tabs
           | if you closed them?
        
             | Ajedi32 wrote:
             | Maybe a sufficiently good implementation of history search
             | could replace the need for bookmarks entirely. Instead of
             | just matching on page titles, match on content as well.
             | Rank results according to relevance and time spent on the
             | page.
             | 
             | Or alternately, maybe bookmarks could become an extension
             | of existing tab management features. Something like
             | Chrome's tab groups or the Tree Style Tabs[1] extension for
             | Firefox, but with the ability to "archive" tabs or groups
             | of tabs into a searchable repository for later reference.
             | 
             | Just some ideas...
             | 
             | [1]: https://addons.mozilla.org/en-US/firefox/addon/tree-
             | style-ta...
        
               | earthscienceman wrote:
               | These are actually really good ideas, I had never thought
               | of it like this but I like it. History is really all you
               | need in the end. Bookmarks are just a starred version of
               | history, which could easily be included in the matching
               | algorithm you're talking about.
        
               | robertoandred wrote:
               | Safari's history search has been able to search content
               | for a probably decade now.
        
             | tomjen3 wrote:
             | How can they be outdated? I have a bookmark folder at work
             | related to some internal systems that I need to access to
             | do a specific job. Being able to open a bunch of specific
             | URLs at once and then have access to what I need right away
             | is really, really nice and I haven't found any other way to
             | get close.
             | 
             | The same with youtube videos (I like to run hour long
             | videos that create a soundscapes in the background), it is
             | super easy to create a collection that you can open with
             | just a few clicks.
             | 
             | This doesn't mean bookmarks are a substitute for lots of
             | tabs, but I still think bookmarks have a place.
        
             | csdvrx wrote:
             | > I'm not sure what they should be replaced with
             | 
             | Try Edge, the collection feature is a game changer.
        
           | pps wrote:
           | Opera has a nice way to deal with this problem - contexts
           | (similar to tabs groups in other browsers, but it completely
           | removes unneeded stuff from tab bar) and recently they also
           | introduced pinboards. I recently came back to Opera and I'm
           | quite impressed of how this works
           | https://www.youtube.com/watch?v=R2FbCCCmV9U
           | 
           | Oh, and "Flow" which is something like personal chat app, you
           | can send links and notes and have access to them from Opera
           | on mobile too. It's achievable in other ways obviously, but
           | the workflow here is smoother, because it's built in and
           | sharing link to website is done with one click.
        
           | danShumway wrote:
           | Not going to expand on your point too much, but I've
           | commented similarly in the past, and I heavily agree with
           | you. There's so much room for innovation in browser UX,
           | Bookmarks and tab archival never really evolved and it feels
           | like we're just stuck in the past.
           | 
           | Part of the problem is that it's tricky for people to
           | innovate on bookmarks in an accessible way, because I'm not
           | going to do heavy browsing in a 3rd-party Chromium fork that
           | doesn't have Firefox's privacy tools or support for Ublock
           | Origin.
           | 
           | But more experimentation with bookmarking systems would be
           | very welcome. In the meantime, here I sit with my 977 open
           | tabs.
        
             | slightwinder wrote:
             | > Part of the problem is that it's tricky for people to
             | innovate on bookmarks in an accessible way
             | 
             | Actually, I think it should be very simple. We already have
             | Tree Style Tabs and it has Group-Tabs. Just mirror the Tab-
             | Tree with a Bookmark-Tree, where Group-Tabs are folders,
             | done. There is already a tab-tree-addon doing something
             | similar (was it sideberry?), but it's still a bit fizzy and
             | unstable and needs more polishing. I guess firefox itself
             | needs more optimization in that area.
             | 
             | Similar could be done with Tab-Groups, when done good.
             | There used to be a XUL-addon which added a tabbar for
             | groups. Combined with tree style tabs on the side, this
             | made a really awesome interface. I'm still sad that addons
             | can't do this today anymore.
        
             | hsbauauvhabzb wrote:
             | I respectfully disagree with both of you. A tab _is_ a
             | bookmark, the fact that tabs are allowed to run background
             | processes and consume a crazy amount of system resources is
             | the problem.
             | 
             | Why the hell is JavaScript allowed to run amok? I
             | understand things like Spotify, but Facebook has no need to
             | stream news feed updates if you aren't even looking at the
             | page. It really needs to be up to browsers to stop this
             | behaviour because obviously JavaScript devs don't self
             | regulate.
        
           | NmAmDa wrote:
           | A reference manager like zotero would help. You can add non-
           | paper references easily also.
        
           | asdff wrote:
           | I hear your qualms about bookmarks but to me having 100 open
           | tabs does not save you from any of those issues at all, it
           | just exposes you to things you never would have encountered
           | otherwise. Macbooks I've owned randomly crash, always has
           | always will. If I had 100s of tabs that would certainly be
           | annoying to deal with opening that session again and watching
           | my computer achieve liftoff with the fans when those 100 tabs
           | open at once again.
           | 
           | Personally as a scientist I'm aghast you operate this way. If
           | you were my student I would change everything about this
           | system of yours. My word. Use folders for your bookmarks to
           | keep things organized. Save important documentation as local
           | pdfs so you can refer to it when you need to keep working and
           | the site is down and you can't click to new pages (happened
           | to me before). Use zotero for gods sakes to organize your
           | literature. Just do it, promise me you will. You've given me
           | a headache just imagining your workflow :)
        
             | kyleee wrote:
             | People have different work flows and that's ok. No need to
             | be so controlling...
        
           | hiq wrote:
           | It sounds like you could just close these tabs once you
           | switch to another one, or maybe have a timer on them so that
           | they auto-close after N hours. There are probably extensions
           | for that.
           | 
           | I use very few bookmarks now, the ones I have are just for
           | websites that may be hard to find, or simply the ones that I
           | visit enough to want a quick suggestion when I start typing
           | the URL.
           | 
           | I almost never regret closing a tab, if I need it I can find
           | it again. If not, it means it was not that relevant, and I
           | might just as well start a new search from scratch to
           | possibly find a better link instead.
        
             | oauea wrote:
             | Auto discard + tree style tabs = no reason to actually
             | close tabs.
        
         | floren wrote:
         | Firefox crashes _completely_ at least once a week for me, and
         | tabs crash at least once a day. I had a brand new tab crash the
         | other day, just seconds after I had opened it and visited a
         | text-only site (no JS, no images). I 'm running Firefox 92 on
         | up to date Debian on a machine with 64GB of memory; it's not
         | running out of RAM.
         | 
         | I still use it because it's better than Chrome, and I wouldn't
         | touch Brave with a 10 foot pole.
        
           | trog wrote:
           | What add-ons do you have installed? I've never had a problem
           | like this in Firefox, in the 10+ years it has been my primary
           | browser (on Windows though). Have you done a memory test too?
           | Something definitely sounds broken here.
        
           | kaba0 wrote:
           | That doesn't sound normal. Perhaps your profile is in some
           | sort of inconsistent state after years of usage? Maybe give
           | it a try with a new empty profile as well.
        
           | hsbauauvhabzb wrote:
           | Recently switched to chrome as a many tab used, it's less
           | stable than Firefox for me.
        
           | Vindicis wrote:
           | I've ran into weird issues like that before. After so many
           | updates, I'm guessing something gets broken somewhere,
           | somehow.
           | 
           | Back up your extension settings and bookmarks, and do a fresh
           | install of it. Bit of a nuisance but usually fixes any weird
           | behaviour in my experience.
        
       | vorticalbox wrote:
       | > trigger the Firefox-internal memory-pressure warning allowing
       | subsystems in the browser to reduce their memory use.
       | 
       | If the sub systems can reduce their meneory use why not do that
       | by default?
        
         | evilpie wrote:
         | It's a classic performance/memory tradeoff. There are caches
         | that aren't strictly necessary for the page to work, but
         | throwing them away causes slowdowns.
        
       | kazinator wrote:
       | > _Firefox will respond by unloading memory-heavy but not
       | actively used tabs._
       | 
       | A dropped tab cannot always be reloaded to the same content. No
       | thanks, I'd rather get more RAM or swap space for paging.
       | 
       | The tabbing feature of "close all pages to the right of this one"
       | is almost good enough for me.
       | 
       | What I would like is some UI where all the tabs are compactly
       | shown as rows in a table. Here, you could select tabs and move
       | them up or down, delete them, or farm them off to their own
       | window.
        
         | smw wrote:
         | The Tree Style Tab add-on might be relevant to your interests?
         | It's a little flaky since the switch to new style extensions,
         | but still better than any other option I've seen:
         | 
         | https://addons.mozilla.org/en-US/firefox/addon/tree-style-ta...
        
           | kaba0 wrote:
           | I've recently replaced it with Sideberry which seems to be
           | more performant.
        
           | lucb1e wrote:
           | Seconded. I can't make heads or tails of other people's tabs
           | but mine are in this neat list. Must say I don't use the tree
           | feature at all and I disabled any kind of collapsing
           | behavior, it's just vertical tabs (that Mozilla supported
           | with an extension of their own! For all of two versions...)
           | that help me with working on (looking at) various things in
           | parallel across weeks.
        
       | ksec wrote:
       | I left Firefox for a number of years already. Did Firefox changed
       | its Tab Unloading behaviour? I remember Firefox will unload Tabs
       | that are inactive after a period of time. So having OOM crash on
       | Firefox was a relatively rare occurrence even when I had hundreds
       | if not thousands of tabs.
        
         | kbrosnan wrote:
         | If you had restore tabs on restart then tabs that were in the
         | background and not pinned would not be loaded until focused.
         | Tabs would not be unloaded unless you restart the browser. The
         | first implementations were in the Fx 20 range and some
         | additional improvements in the 55 timeframe. The feature in 93
         | is suspending without the need to restart the browser.
         | 
         | https://www.google.com/search?client=firefox-b-1-d&q=site%3A...
        
         | kevingadd wrote:
         | I've never seen Firefox unload an inactive tab without my
         | permission, but it looks like according to the docs it's had a
         | 'memory is low, unload tabs' mechanism since 2019. It looks
         | like that behavior was further adjusted in this release, though
         | it's not clear to me what the difference is.
        
       | parhamn wrote:
       | I've been experimenting and exploring a few ways to implement
       | this for my own browser [1].
       | 
       | The options seem to be:
       | 
       | - Great Suspender style suspension [2] - swap page with a simple
       | low memory placeholder and reload back (detecting interactions)
       | 
       | - Chrome/FF style tab discarding (only happens with memory
       | pressure) [this post and 3]
       | 
       | - Optimistic unloading with screenshots (this is what we're
       | experimenting with) - we suspend the tab and replace it with a
       | screenshot of the tab before it was suspended, you trigger a
       | reload if you need it. It seems that the screenshot gives you
       | access to the information you cared about while being easy to
       | unload and reload from memory and making it much less likely you
       | actually trigger a reload.
       | 
       | One final one I've been thinking about that I haven't gotten
       | around to testing yet for fast-fan-syndrome (and non-memory
       | limited systems) is to just use renice/cputhrottle (in macOS for
       | example) to force CPU share limits on the processes. This has
       | portability issues and requires certain privileges which is why
       | I'm hesitant to try it immediately.
       | 
       | These obviously have their issues like stopping the JS VM when
       | there might be long running thing that was actually desired
       | (usually prevented with a whitelist).
       | 
       | Happy to test any other ways you think might work!
       | 
       | [1] https://synth.app [2]
       | https://chrome.google.com/webstore/detail/the-great-suspende...
       | [3] https://developers.google.com/web/updates/2015/09/tab-
       | discar...
        
         | nvrspyx wrote:
         | Why not cache the HTML/CSS instead of using a screenshot? I'm
         | no expert on web/browser development, so I don't know the
         | difficulty or feasibility in caching just the visible bits
         | leaving a static HTML/CSS snapshot minus any javascript seems,
         | but it seems more ideal IMO since you'd still be able to click
         | links.
         | 
         | Just a thought
        
           | parhamn wrote:
           | Good Q! It is something we are looking at/trying. It's a bit
           | more complex as you have to have a pool of suspended
           | renderers to swap the html into as the user switches tabs
           | (the HTML still needs to be properly sandboxed). Then you
           | include static asset loads, etc it becomes less 'instant'.
        
       | csmpltn wrote:
       | > "On Windows, out-of-memory (OOM) situations are responsible for
       | a significant number of the browser and content process crashes
       | reported by our users."
       | 
       | You got this wrong, yet again. What causes the memory to run out
       | in the first place? That is what you should be fixing.
        
         | mikepurvis wrote:
         | Why do computers keep getting more and more memory? 640KB
         | should be enough for everyone, if people would just fix
         | whatever is using up all the memory. /s
         | 
         | Not all OOM situations are because of a malfunction or leak.
        
           | cuu508 wrote:
           | Let's say you want to have a wallpaper on your 1920x1080
           | desktop. At 24bpp, that's ~6MB right there.
        
             | mikepurvis wrote:
             | I've added a sarcasm indicator to my post to clear up any
             | confusion. The point is that there are lots of valid
             | reasons to use an unbounded amount of memory, and it's
             | reasonable to expect unbounded-memory-using applications to
             | have mechanisms which free that memory over time without
             | direct user intervention (eg, manually closing a tab).
        
         | cottager2 wrote:
         | Surely you must admit that even an extremely memory efficient
         | implementation of a set of tabs has a physical limit on how
         | many can be open if they're all loaded into memory.
        
         | kevingadd wrote:
         | I have approximately 300 tabs open. How much memory should that
         | use? What's your answer based on?
        
         | MayeulC wrote:
         | You seem to assume it comes from the browser. That is not
         | necessarily the case: the user might have launched a demanding
         | game that suddenly increases memory pressure, making Firefox
         | OOM. FF will now more gradually release memory to the OS.
        
         | yjftsjthsd-h wrote:
         | > What causes the memory to run out in the first place? That is
         | what you should be fixing.
         | 
         | Either the user opened enough tabs to use memory, or the rest
         | of the system is using too much memory. Neither of those is
         | "fixable"; a browser that randomly closes your tabs or kills
         | other programs is not going to be well received.
        
           | chupasaurus wrote:
           | Or one tab starts leaking memory like crazy after some time
           | (looking at you Jenkins).
        
       | Buttons840 wrote:
       | I'd like it if tabs that haven't been looked at for an hour just
       | closed. Any suggestions on how I can do this?
       | 
       | I think this is a very unpopular way of using tabs though. Most
       | people seem to use it as a sort of work queue and leave tabs open
       | for days or longer. I hate doing that, I'd rather just search for
       | the information again or look in the history.
        
       | Lammy wrote:
       | I can't reply to the dead comment here, but if you're looking for
       | a tunable version of this functionality try
       | https://addons.mozilla.org/en-US/firefox/addon/auto-tab-disc...
        
         | ihsw wrote:
         | Thanks.
        
       | NoGravitas wrote:
       | Just updated Firefox Developer Edition and got this, as well as a
       | new "Colorways" auto-theming feature. Pretty nice, so far!
        
       | favorited wrote:
       | Something surprising I learned recently is that this is an anti-
       | pattern when building an iOS app. iOS has a memory compressor, so
       | if you try to purge resources in a low-memory situation, it can
       | cause memory use to spike as the things you're trying to free get
       | decompressed.
       | 
       | The SDK provides a notification when memory pressure is high, so
       | people try to get aggressive and purge their caches and unused
       | assets when that notification arrives, but that only makes the
       | problem worse.
        
         | bombcar wrote:
         | Sounds like they need a "free without uncompressing" feature.
        
           | favorited wrote:
           | I think the issue would be that the compressor works on whole
           | memory pages (I assume), so you'd need to know that the whole
           | page could be freed. There might be kernel VM functions to
           | handle that functionality manually, like if you were building
           | a zone allocator or something?
        
         | rogers18445 wrote:
         | Linux and Android have that too. Called Zram. When using zstd a
         | compression factor of 3.5 on swap memory is common.
        
           | saagarjha wrote:
           | Apple accelerates this compression in hardware, given that
           | it's on an extremely hot path-especially when the system is
           | under memory pressure.
        
         | saagarjha wrote:
         | Plus, the code to handle that is likely little-used and may
         | have been dumped. Just being able to run the handler that does
         | low-memory handling may pull in things and increase pressure.
        
       | szundi wrote:
       | Someone should tell all these guys about the memento design
       | pattern.
        
       | doc_gunthrop wrote:
       | Will this also be implemented in the mobile browsers (e.g.
       | Firefox for Android)?
        
         | cpeterso wrote:
         | I don't think it's necessary because Android has its own OOM
         | killer and Android apps must be written to handle Android's OOM
         | signals.
        
       | diamondo25 wrote:
       | I actually installed Firemin[1] and it really helped getting
       | Firefox's memory usage down (while keeping the browser usable!).
       | Some days I wasn't able to play games because Firefox ate up a
       | large chunk of memory, even though I have 32GB installed!
       | 
       | Its pushing Firefox to purge memory more and more, and it managed
       | to reduce memory usage from gigabytes to under 500MB (used, not
       | allocated).
       | 
       | [1] https://www.rizonesoft.com/downloads/firemin/
        
       ___________________________________________________________________
       (page generated 2021-10-05 23:00 UTC)