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?
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!
Weird. I got opposite results of Wil, with both fresh browser starts as well as ones I've had open for a few days.
Opening a new tab to google.ca (+7508k):
Closing the new tab and opening a new one to superuser.com (+1032k):
Reusing the newly opened tab to thedailywtf.com (-640k):
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.
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. :)