Firefox is chewing through your NAND

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

keybored

Active Member
May 28, 2016
280
66
28
Apparently things are worse than I originally thought and "recovery.js" isn't the only file involved. In case someone wants to replicate, here's what I did this morning. I reset browser.sessionstore.interval to 15000 and then got rid of all my currently open FF windows. Opened a single window with just Google running in it, left it sitting for a couple of minutes, and then closed it. Started the browser again and on this final restart the recovery.js file was only 5KB in size, down from around 900KB before.

Next, I opened a bunch of random reviews for Samsung 850 pro and Samsung Galaxy S7 in two separate windows. Literally just googled "samsung 850 pro review" and "samsung galaxy s7 review" and then went down the list of results opening them in new tabs. Opened a 3rd window and created a bunch of tabs showing front pages for various news sites.

firefox-disk-activity-windows-1.jpg
Recovery.js at this point was at ~60KB.
Launched Process Monitor and configured it to track recovery.js and cookie* files:

firefox-disk-activity-process-monitor-config-1.jpg

Went to File->Capture Events and disabled it. Cleared all events that were currently showing up. Went back to File->Capture Events and re-enabled it. Left the three FF windows sitting idle for 45 minutes while I was using Chrome instead. Then I went to Tools->File Summary to get overall stats. Firefox managed to write 1.1GB to disk with the vast majority of data going into cookie* files.

firefox-disk-activity-file-stats-1.jpg

Note that recovery.js managed to accumulate only about 1.3MB of writes.

Went back to one of the Firefox windows and opened my outlook.com mailbox. Cleared all events in Process Monitor and re-started the capture. Again, left all Firefox windows sitting idle, but only for ~10 minutes. This time recovery.js was at ~1.5MB and it took only about 1/4-th of the time to get there. Cookie* files had a ton of data written to them, as before.

firefox-disk-activity-file-stats-2.jpg

So, looks like depending on what you've got open in your tabs, Firefox could be dumping tons of data into recovery.js, cookie* files, or both. Running at 1.1GB for every 45 minutes, you're looking at ~35GB/day written to your SSD if you leave your machine running. And at least in my case this wasn't even the worst example of how much data could be going into recovery.js. In my original tests I clocked Firefox at 2MB/s writing to this file and the writing thread never went dead always showing up on the top of the list in Resource Monitor.
 

T_Minus

Build. Break. Fix. Repeat
Feb 15, 2015
7,749
2,128
113
At first I just laughed and thought no way... but now, I have no reason as to why my writes are so high. Which, now makes me wonder if most of my writes are from FireFox.

My Samsung 950 Pro 256GB primary OS drive (Windows 10).

I believe I installed it around December 2015 is showing 3.56 TBW as of 9-21-2016 (9:05 AM PST).

I only have 1.5Mbit internet so I don't write to it much, in the last couple months I've written maybe 50GB of video being 'large' data I've dealt with on my local desktop. My games are on other SSD. My storage is on my network. I have downloaded approx 110GB of files through my Desktop since Dec. 2015.

With that said, I somehow write almost 4TB in less than 12 months. I know Windows 10 may be worse than Windows 7, but I disabled a lot of win10 features both within windows and with 3rd-party/edits so I know it's not caching, etc,...




@keybored I'll be looking into running some of those tests / monitoring the way you did and report back.
 

keybored

Active Member
May 28, 2016
280
66
28
What happens when you run with private browsing enabled?
There was virtually no activity with that set of files when I opened the same tabs in a private browsing session. It's either keeping most of the stuff in memory or saving it in a different set of files that are not being monitored.
 
  • Like
Reactions: tukoz

Jame5

New Member
Aug 19, 2016
2
5
3
46
As an aside, this behavior is not new.

Back in 2010 on Linux, I wrote a script that on boot, would load my .mozilla/firefox folder to tmpfs. Once an hour, it would sync back the tmpfs copy to disk.

Why did I do this? At first, it was because Firefox was so spammy with writes to that sqlite database that it bogged down the spinning disk I was using at the time. Aft upgrading to an SSD, I kept the script in place, simply because I knew that Firefox was constantly pounding that database file, and didn't want it wearing out my (then fancy) OCZ 30GB SSD that I was using for my base OS drive.

There was a lot of back and forth about Firefox using sqlite to store information and how it was chewing up I/Os on systems back then. It's funny that this has now become a reportable issue yet again.
 

T_Minus

Build. Break. Fix. Repeat
Feb 15, 2015
7,749
2,128
113
This may explain issues people have with their parents' computers... I know my parents use their desktop for browsing and outlook 90% or more of the time, and often 5-8hrs a day spread throughout, tons of tabs, and multiple windows.

FireFox and retiree hard drive killer...
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,533
5,854
113
upload_2016-9-23_9-38-32.png

Looks like Chrome writes a lot too: 78 tabs open across 3 windows.
 

wildpig1234

Well-Known Member
Aug 22, 2016
2,293
557
113
49
Thanks for the info.... I have to say I m horrified... I would rather not have any recovery files and zero write to my ssd if I have to pick. ... wtf is wrong with all the browser companies? Dont they realize that most people nowaday have ssd as their boot drive?

Gonna hv to install that software asap tonite ti check.... I use ie and chrome and edge... does anyone know if those 3 do anything like this ?
 

keybored

Active Member
May 28, 2016
280
66
28
...

There was a lot of back and forth about Firefox using sqlite to store information and how it was chewing up I/Os on systems back then. It's funny that this has now become a reportable issue yet again.
What's interesting to me is that nothing has evidently been done about this if the issue has been known since 2010.
What I'm also finding out is that this Firefox behavior while idle is only one side of the coin. These cookie* files are being written to with every click/page load. Tracked a few clicks yesterday and each one cost at least 1MB in writes. 10 clicks -- 10MB written to your SSD...
 

PigLover

Moderator
Jan 26, 2011
3,215
1,571
113
I think the better solution is stop using Firefox. It used to be lean and tight and better than the others, but over the last 2-3 years its become fat and bloated and something of an also-ran.

Except at work - where a quirky firewall issue ties my hand - I've moved on to Chrome and not looked back. Using Firefox at the office reminds me every day that this was a good decision.
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,533
5,854
113
30 minutes into the session over 350MB written with Chrome. That is a 16GB/ day pace. Seems like the local cookies stores are the largest offenders.
upload_2016-9-23_10-26-53.png
 

cheezehead

Active Member
Sep 23, 2012
734
179
43
Midwest, US
I've been still using FF heavily but have migrated with FF and Chrome to using private browsing normally to reduce the disk I/O.
 

Jame5

New Member
Aug 19, 2016
2
5
3
46
Went ahead and rebuilt my firefox to tmpfs file.

Adding a cron for @reboot and every half hour.

Code:
#Firefox to tmpfs onboot cron
@reboot /home/jsmith/scripts/firefox_tmpfs

#Firefox every half hour tmpfs to disk sync
*/30 * * * * /home/jsmith/scripts/firefox_tmpfs
 

Attachments

G-R-M

New Member
Sep 23, 2016
2
0
1
52
browser.sessionstore.resume_from_crash looked promising,
See browser.sessionsstore.enabled:

Since Firefox 3.5 this preference is superseded with setting browser.sessionstore.max_tabs_undo and browser.sessionstore.max_windows_undo to 0.

----------------------------


CrystalDisc Info says about my Samsung 840 Pro:

Total LBAs written: 11782606898
Power-on hours: 11549


When my computer is turned on, Firefox is almost always running with five till 15 opened tabs.

11782606898 LBAs. One LBA is 512 Bytes, isn't it? Then 11782606898 LBAs should be round about 5620 GB, or 5.5 TB.

Round about 0.49 GB per hour.

Edit:

If you frequently cleanup your profile, you also can write those preferences into the file "user.js". I will write the modified preference "browser.sessionstore.interval" to user.js.

Edit 2:

Naturally my 0.49 GB cannot be compared with yours, because there are other programs that write to my SSD.
 
Last edited: