Firefox is eating your SSD, here is the solution

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

Firefox is eating your SSD, here is the solution

#1 Post by tallboy »

Firefox is constantly writing to a file recovery.js in your storage, also when idle, to be able to restore your browser, if it for some reason crashes.
It can be modified in about:config, the setting is named browser.sessionstore.interval, and has a default value of 15 seconds. (setting is in milliseconds) .
The setting means that the last 15s is all the work you will lose if the browser is restarted after a crash. Chrome has the same problem.
Here is a couple of good articles covering the subject, with a detailed analyzis of the problem, and a solution:

https://www.servethehome.com/firefox-is ... to-fix-it/
http://www.myce.com/news/firefox-chrome ... ime-80534/

In Palemoon the default setting is 60s. (60000)

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

Thanks for that info.

I found that SeaMonkey does the same thing.

It can also be fixed by editing 'prefs.js', but do so when SeaMonkey is not running.

Posted about it on blog:
http://barryk.org/news/?viewDetailed=00639
[url]https://bkhome.org/news/[/url]

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#3 Post by watchdog »

BarryK wrote: It can also be fixed by editing 'prefs.js', but do so when SeaMonkey is not running.
It can also be fixed by copying in browser's profile a file user.js leaving prefs.js untouched:

Code: Select all

// set to half 1 hour writing on device recovery.js:
user_pref("browser.sessionstore.interval", 1800000);
Tested in palemoon.
Last edited by watchdog on Sat 12 Aug 2017, 10:29, edited 1 time in total.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#4 Post by bigpup »

I do not have a big need for this option at all.

Here is how to Completely disable session store.

in about:config

Firefox 3.5 and above:
you can set the preferences browser.sessionstore.max_tabs_undo and browser.sessionstore.max_windows_undo to "0".

More info here on modifying features of session restore:
http://kb.mozillazine.org/Session_Restore
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#5 Post by tallboy »

Thank you, watchdog and bigpup.

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#6 Post by rufwoof »

Writes to something like

~/.mozilla/firefox/xxxxxxxx.default/sessionstore-backups/recovery.js

where xxxxxxxx is a alphanumeric series unique to your firefox profile

Perhaps yet another alternative might be to set that to be a ram based file.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#7 Post by tallboy »

The sessionstore.js file itself is not very big. I don't know if writing to it every 15 sec. is regarded as download time. If so, even for a short time and a friendly ISP, it eventually has to be paid for.

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
8Geee
Posts: 2181
Joined: Mon 12 May 2008, 11:29
Location: N.E. USA

#8 Post by 8Geee »

Most of this is already done in my particular spins for Slacko5.7. However, I agree that

browser.sessionstore.max_resumed_crashes
browser.sessionstore.max_tabs_undo
browser.sessionstore.max_windows_undo

should all be set to zero in about config

browser.sessionstore.interval;3600000
interval is 1 hour

Thanks for bringging this to everyone's attention.

Regards
8Geee
Linux user #498913 "Some people need to reimagine their thinking."
"Zuckerberg: a large city inhabited by mentally challenged people."

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#9 Post by belham2 »

8Geee wrote:Most of this is already done in my particular spins for Slacko5.7. However, I agree that

browser.sessionstore.max_resumed_crashes
browser.sessionstore.max_tabs_undo
browser.sessionstore.max_windows_undo

should all be set to zero in about config

browser.sessionstore.interval;3600000
interval is 1 hour

Thanks for bringging this to everyone's attention.

Regards
8Geee

I'd like to add to 8Geee's good advice above to also make sure:

browser.sessionstore.restore_on_demand
browser.sessionstore.restore_from_crash


are both changed to "false", and not left at the default "true"

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#10 Post by tallboy »

Thank you 8Geee and belham2 for following up.

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#11 Post by tallboy »

One of the about:config settings mentioned above, made my Palemoon unresponsive to 'Undo Close Tab'! So by resetting one by one, I found that browser.sessionstore.max_tabs_undo should not be set to 0 if you want to be able to reopen closed tabs. The 'reset' option set the value back to default 10, and everything is OK again.

BTW, with my Palemoon modified according to suggestions above, it crashed because of stupid behaviour from it's user (me :oops: ), but reopened with most of the relevant tabs intact, i.e. those which had been open for more than one hour.

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#12 Post by bigpup »

tallboy you have sessionstore turned on and working.
What you describe is what it does for the browser.

You may only have the tab part working, but it is doing what this topic started out trying to tell people how to make it stop.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

Peterm321
Posts: 411
Joined: Thu 29 Jan 2009, 14:09
Location: UK

#13 Post by Peterm321 »

For the nuclear option, that is to say, stop Firefox writing to a SSD altogether, it is possible to run Firefox with the --profile <path to profile folder>
argument.

If the profile folder is copied from the SSD to /tmp, and /tmp is mounted tmpfs then the writes tend to be in RAM and will spare the SSD.

Of course if there is a need to reboot or the system panics, all the work is lost. It might be possible to use a script to loop the cp -ur command (copy only changed files) to the SSD every five or ten minutes. It might also be possible to set up a bespoke profile folder on tmpfs but use symlinks for certain files or folders that need to be kept on permanent storage, for example cookies, history, the cache.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#14 Post by tallboy »

bigpup and Peterm321, I set my browser.sessionstore.interval to 3600000, which equals a 1 hour interval between writes.
Besides, I usually run off a live CD, so the SSD part does not mean much to me personally. But, the setting above also writes to the same file sessionstore.js when it is localized somewhere in RAM, so I believe anything that will free up RAM and CPU activity is good.
Here are my settings: (Palemoon 27.4.1)
Attachments
about-config.jpg
(73.66 KiB) Downloaded 504 times
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#15 Post by tallboy »

Some additional comments, I hope the moderator will se the relevance, and keep it here.
If some form of sessionstore is kept or applied, one question may be what to do with the setting browser.sessionstore.privacy_level:
mozillazine.org wrote: This preference controls when to store extra information about a session: contents of forms, scrollbar positions, cookies, and POST data.
Possible values and their effects
0 Store extra session data for any site. (Default starting with Firefox 4.)
1 Store extra session data for unencrypted (non-HTTPS) sites only. (Default before Firefox 4.)
2 Never store extra session data.
As you can see above, Palemoon defaults to 1, I will change to mine to 2.
mozillazine.org wrote:browser.sessionstore.privacy_level_deferred (new in Firefox 4) - controls what gets saved by Session Restore when quitting (not crashing or restarting to install updates/addons) with browser.startup.page *not* set to restore previous session on startup.
Possible values and their effects
0 Store extra session data for any site.
1 Store extra session data for unencrypted (non-HTTPS) sites only.(Default)
2 Never store extra session data.
Palemoon defaults to 1, I will change to mine to 2.

browser.sessionstore.postdata
POST data contains info that potentially could resend an email or re-submit an order, it defaults to 0, and should be kept at that!
Possible values and their effects
-1 No limit on amount of stored POST data
0 Do not store POST data in saved sessions (Default)
Choose any positive integer: Store this many bytes’ worth of POST data per saved history entry in saved sessions.
browser.sessionstore.postdata in Palemoon defaults to 0, and I see no reason to modify that.
If this preference is set to anything other than 0, you may want to also keep browser.sessionstore.privacy_level set to 1.
keep browser.sessionstore.privacy_level must be set to 0 or 1 for this preference to have an effect.

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

Peterm321
Posts: 411
Joined: Thu 29 Jan 2009, 14:09
Location: UK

#16 Post by Peterm321 »

tallboy 18 August 2017, 18:28 wrote: Besides, I usually run off a live CD, so the SSD part does not mean much to me personally. But, the setting above also writes to the same file sessionstore.js when it is localized somewhere in RAM, so I believe anything that will free up RAM and CPU activity is good.
I was mistaken in my interpretation. However if the live CD is run with a savefile SSD writes may be happening depending where the profile is located.

Anyway another way to save memory is to limit the cache. I prefer to limit the cache to about 1/5th free RAM, others may prefer more or less:

about:config
browser.cache.disk.parent_directory
http://kb.mozillazine.org/Browser.cache.disk.capacity

browser.cache.disk.capacity
http://ccm.net/faq/40745-firefox-how-to ... les-folder

http://ccm.net/faq/40819-firefox-36-how ... cache-size

https://www.davidtan.org/tips-reduce-fi ... che-usage/

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#17 Post by tallboy »

One addition that came in Palemoon 27.3.0, and which doesn't seem to be part of a firefox setup, is browser.sessionstore.cache.behaviour:
the Palemoon 27.3.0 changelog wrote:Added an option (browser.sessionstore.cache_behavior) to control from which source restored tabs pull their page content:
0 = load restored tab data from cache (current behavior, default).
1 = refresh restored tab data from the network.
2 = refresh stored tab data from the network and bypass any cached data.
tallboy
True freedom is a live Puppy on a multisession CD/DVD.

Post Reply