Firefox Tab Recycling

2

I have a somewhat academical question. When using Firefox, would it be better for memory usage if, when going to a website, with an unused tab available, I:

  • Close that tab, then open a new one with the new site?
  • Reuse that tab?

Bart van Heukelom

Posted 2009-12-21T23:24:32.783

Reputation: 1 958

Answers

3

I just did an unscientific experiment and the answer is Close the tab then open a new one, but we are talking about marginal.

My Firefox takes up 242.7MB, I opened up a new tab with Google and it went to 244.9MB, I then closed the tab and it went to 242.8MB.

I then opened up Microsoft.com in a new tab and it went to 248MB, Closed it and went back to 242.7MB.

I then opened up Google and it went to 244.8MB, Then went to Microsoft.com and it went to 257MB, went back to Google.com and it went to 246.7MB, closed both and it went to 243.1MB

So, it uses less memory to close, however, we are talking about hardly anything and I will not be changing my browsing habits anytime soon!

William Hilsum

Posted 2009-12-21T23:24:32.783

Reputation: 111 572

2

This largely depends upon the activity in each tab. Are you storing a lot of browsing history? Are the pages in that tab available for pre-fetching? Unlike Chrome which uses a per process tab model, Firefox has a session based model per tab. Also the most recently closed tabs are available for "Undo" so closing it doesn't necessarily free up memory. If you want to limit the total amount of memory for the lifecycle of the entire process, there are configuration options you can tweak.

Here's an article discussing some of the about:config tweaks you can use that are related to heavy tabbed browsing.

  1. Go to about:config in Firefox.
    • Type in “session” in the “Filter” box.
    • Edit browser.sessionhistory.max_entries – this is the number of pages stored in the history of your browsing session. Basically these are pages that can be reached using your Back and Forward buttons. The default is 50 – I reduced it to 20.
    • Edit browser.sessionhistory.max_total_viewers – this is the number of pages that are stored in RAM so that they aren’t re-processed by Firefox’s rendering engine. This is what allows you to go Back to a page in Firefox and have it load almost instantaneously. The number of pages stored actually depends on the amount of RAM on your machine (see this). I reduced this to 4 (I have 2GB RAM).
    • Edit browser.sessionstore.max_tabs_undo – the number of tabs you can restore after closing them (you can do this with Ctrl/Cmd-Shift-T). The default of 10 is more than I really need, so I reduced it to 3 tabs.
    • Edit browser.sessionstore.interval – Firefox saves your session after every 10 seconds by default. I changed this to a more conservative 30000 milliseconds.

Darren Hall

Posted 2009-12-21T23:24:32.783

Reputation: 6 354

Well I have more than enough RAM available. I was just curious from an academical perspective. – Bart van Heukelom – 2009-12-22T13:44:09.927

0

Weird. I got opposite results of Wil, with both fresh browser starts as well as ones I've had open for a few days.

Initial Launch:

alt text

Opening a new tab to google.ca (+7508k):

alt text

Closing the new tab and opening a new one to superuser.com (+1032k):

alt text

Reusing the newly opened tab to thedailywtf.com (-640k):

alt text

This is only 1 sample out of a lot of possibilities. The websites you open will also have different effects depending on the extras (eg. javascript) that need to be loaded and parsed. I'm suprised that reusing a newly opened tab actually lowered the memory usage though. To be fair, I waited it out for about 5 seconds after loading each page until the memory usage stopped moving. Mozilla must have been working a fair bit on memory management in the newer releases as it has improved a lot.

John T

Posted 2009-12-21T23:24:32.783

Reputation: 149 037

0

This would have been a good question if you were investigating the internals of the browser's engine, but for day-to-day browsing you won't notice a difference either way you do it. Don't worry about it and continue browsing however you are now. :)

Sasha Chedygov

Posted 2009-12-21T23:24:32.783

Reputation: 6 616