Firefox Memory consumption MemShrink

Improving “Reset Firefox”

I recently wrote about the wonderful “Reset Firefox” feature, which in one fell swoop can fix all sorts of bad behaviours.  What follows is a number of complaints that commenters had, and some ideas about how to address them.

“The name is misleading”

It’s true.  It sounds like it will erase all of your data and customizations.  The SUMO page says the following.

The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.

“Factory default state” and “while saving your essential information” are two phrases that sit together awkwardly. But it may be too late to change the name now.

“But I have lots of configuration tweaks”

And they’ll all be lost.  You can look in about:support to see “important modified preferences”.  Or you can look at the “user set” entries in about:config.  Or you can look at both, and wonder the two lists are different, and what the definition of “important” is.

It would be very helpful if you could see who or what was responsible for each of those changes.  Was it the user, via the Preferences dialog?  The user via about:config?  An add-on?  Something auto-updated by core Firefox code?  (And why do I always have dozens of “user set” preferences relating to printing, even on my Linux machine that I never print from?)

Would an API tweak help?  We could change the “setPref()” function (or whatever it’s called) to take an additional, optional argument that indicates who set it.  It wouldn’t fix the problem immediately but would give a path forward.

Update: I found bug 834034, which is about preserving a user’s custom spell-check dictionary.

“But I have hundreds of tabs open”

And they’ll all be lost, too.  Apparently the Session Manager extension solves this problem.  But that’s not obvious, and still a pain to manage.  Maybe we could mention it in the documentation?

Update: Alexander Limi pointed me in the direction of bug 833943, which is about fixing this.

“But I have Dozens of add-ons installed”

And one of them might be causing your problems.  You can get the list of installed add-ons from about:addons, so this one isn’t too hard to fix up manually.

“I can’t see the ‘Reset Firefox’ button” / “I want to reset a non-default profile”

The “Reset Firefox” button only shows up in the default profile.  (And sometimes not even there — I don’t get it on my default profile on my dev machine, where I have half a dozen profiles present.)

There’s a bug open about this.  I could be wrong, but it doesn’t sound that hard to fix.

“How do I undo it if it breaks something?”

The SUMO page addresses this.

After the reset is finished, your old Firefox profile information will be placed on your desktop in a folder named “Old Firefox Data.” If the reset didn’t fix your problem you can restore some of the information not saved by copying files to the new profile that was created. See Copying files between profile folders for instructions.

The instructions on copying files between profile folders are clear, except for the fact that even an expert user will have little idea which files within a profile are important.  It’s an intimidating process.

“Why isn’t this automated?”

Well, because it loses some of your configuration.  You don’t want Firefox discarding all your extensions every six months.

“Why is this even needed in the first place?”

Ah.  An interesting question.  What exactly are the sources of the problems that Reset Firefox fixes?

  • Problematic extensions.  This is probably a common cause of problems, especially for people who have toolbars they don’t want and things like that.  And I’ll give a special mention to GreaseMonkey users who have badly written scripts that do horrible things.
  • Bad preference settings.  In my experience, the most likely settings to cause problems are those involving hardware acceleration (e.g. bug 711656). Are there any other classes of preferences that could have big effects?  I guess if the JavaScript JITs were turned off that would slow things down drastically.  I don’t know how people end up with a bad setting, whether it’s by diffling in about:config or extensions or something else.  (The was a dev-platform thread about this last year.)
  • Corrupt(?) state.  This one’s vague, but I suspect it’s a factor.  Maybe some of the SQLite files?  Or perhaps the state isn’t corrupt, but just fragmented in some fashion?  For example, in an oldish profile on my Mac my places.sqlite file size is 73 MiB, and urlclassifier3.sqlite is 42 MiB, which seems like a lot.
  • Do we know of any other causes?

Update: in bug 754933 Michael Verdi lists the following preferences as “troublesome”:

  • home page
  • all search engines (location bar, search bar, right-click)
  • Application settings
  • History settings
  • Password settings
  • Proxy settings
  • Firefox update settings
  • SSL settings
  • All toolbars and controls

I don’t subscribe to the hardline “Reset Firefox shouldn’t even be necessary” viewpoint — software is hard.  But I would like to understand the root causes better, in order to understand if at least some of them could be reduced or prevented.

It’s not all bad

I hope this post doesn’t sound too negative.  I understand that Reset Firefox’s goal was to provide something really simple that’ll fix many problems, and it does that admirably.

It’s just a shame that some power users who genuinely want to improve Firefox’s behaviour are unable to try it because it discards too much data.  I wonder if having additional options (in an obscure corner of the UI) the way safe mode does — “preserve extensions”, “preserve preferences”, “preserve open tabs” — would help those users.  Then those users could use a more incremental approach:  discard some data away, see if that helps, discard some more, etc.

Or maybe that’s not worthwhile;  the people who comment on my blog aren’t exactly typical Firefox users!  And it could complicate things for the SUMO folks — they’d have to ask what options someone used when they initiated a Reset Firefox.  I’m not sure.  I’d just love to extend the goodness of Reset Firefox as far and wide as possible, and it seems like a few small tweaks might help.

25 replies on “Improving “Reset Firefox””

Advanced-mode options for Reset would definitely make me more likely to use it.

I think my big problem with it is that it essentially takes a whitelist approach to clearing state while, as a power user who customizes heavily, the cognitive burden imposed by discarding tweaks I may have forgotten about but still want (eg. stuff I’ve forgotten doesn’t come standard) is too high.

The ability to take a blacklist-style approach and say “Just do X, Y, and Z” where X, Y, and Z are things like “rebuild SQLite databases” would take it from a button I keep my pointer far away from to something I’d try first whenever I’m experiencing problems.

We implemented this a few releases ago, and were deliberately low-key / conservative in its implementation so that we could keep it simple, see how it worked for actual users. It seems to have worked out really well for a lot of people, and we should definitely revisit the feature to see how we can improve it to make it more useful/flexible for people. Thanks!

(And why do I always have dozens of “user set” preferences relating to printing, even on my Linux machine that I never print from?)

The code which is supposed to (but does not) persist print settings from one print job to the next abuses prefs.js as a data store. I don’t know why it gets run even if you never print anything, but this is the very next thing I mean to take the ol’ chainsaw to if I ever get bug 629500 done.

Yikes! It’s possible that I once tried to print or print-preview something with this profile.

I used it and it got rid of escalating CPU usage — CPU was going to 107% in less than 24 hours, now stays under 5%. So I’ll continue to use it unless something bad happens.

Preserving tabs is essential. I use Session Manager and there doesn’t seem to be a way to export or import tabs, but I have figured out what files to copy over.

Ideally I’d like all extensions I use to have an “import from” mechanism, so I can reinstall the extension and import the old settings or other data. If I had that, I’d pretty much be set.

My Google-fu has failed me, but I swear I read a blog post by a Mozillian about a month or 2 (or 8) ago where they’d come up with a clever way to save and restore open tabs (and maybe windows?) across a profile reset.

If I recall correctly, the post included code you can paste into the Error Console to dump out the locations currently open in your various windows and tabs. The output may have been more JS for you to paste in after the reset, but my recollection is clearly failing me.

Maybe I dreamed it.

If I didn’t, it must have been syndicated to Planet Mozilla or PM/Projects, since those are the only Mozilla-centric aggregators I skim.

For saving tabs, it’s easy just to “Bookmark All Tabs…” and reopen all tabs from that set after resetting Firefox.

But for back-up, wouldn’t it be better for Firefox to make a backup-profile of the current one before resetting? Then it is easy to revert or delete depending on how the reset went…

Actually, looking at the comments in bug 833943, I think the “import from” option would be helpful for just about all the user visible information that gets flushed by a reset.

The bug comments express concerns about the various nasties that can get pulled into a profile by retaining session information, messing up the initial state etc. If one has to import the sessions (or preferences, config settings or whatever) this wouldn’t happen up front and it would be a lot easier to figure out what was poisoning the profile. Also finer grained control could be provided over what gets imported if that turns out to be needed.

Plus I think reasonably fine grained “import from” would be useful in creating custom profiles for lots of other reasons. It isn’t always feasible to do this by hand copying files (though it usually is).

I am just wondering, Would a Reset Firefox features that preserve extensions/Addon, preserve “most” preferences, preserve open tabs, be any different to Not using Reset Firefox at all.

My limited test shows a Fresh Firefox that install the same Add On / Extensions and preferences will still be faster. Like you said “Corrupt(?) state. This one’s vague” is what i “think” it is.

I -personally- would be more willing to use the reset Firefox feature if it maintained the settings of three important addons. Those addons are “Adblock Plus”, “Greasemonkey”, and “Stylish”.

The reason is that I use too many custom filters, and manually modify some scripts/styles.

I guess the fact that Firefox backs up your profile is good, since I cannot restore this data from there.

Maybe this feature should (if technically possible) ask the user if they have additional settings they want to save including addon data.

Fortunately, I feel that Firefox is working just fine, so I don’t have the need to use it. I had some problems with leaky extensions in the past that are solved now after the Huey Fix. I never had a “corrupt” profile problem, despite the fact that I use the same profile since Firefox 2.0. I always back up my profile, even when I need to format windows.

It seems a lot of potentially useful info is being lost here. Would it make sense to ask people some time after ‘Reset FF’ has been used whether there has been any improvement, and if so, to report back a diff of the changes? You might over time end up with some data on the most problematic prefs, just by looking at the commonalities.

I don’t get why “Reset Firefox” has to replace the user’s profile when Firefox itself has the ability to have multiple profiles – why not just create a new profile instead with the data “Reset Firefox” is preserving now and setting that as the default profile?

That way, nothing can get lost, and the user can always switch back to the old profile, although adding a a “Switch Firefox profile” menu option or start menu link would make that more discoverable…

It sounds like we need a reset extensions, preferences, etc. option. The reset option can give a new tab with stuff to reset with an explanation behind it. People could try to reset options and try it. If it doesn’t work they can just toggle it back. It could also be nice if the most recent changes to the profile could be identified. So the newest extension, preference etc.

Personal wish-list for the Reset function:

Retain a list of all modified prefs (assuming those prefs are available in the browser; don’t include extension prefs, or deprecated/removed prefs). After reset, and after user has updated values in the regular Options dialog, allow access to that list of prefs so that the user can choose whether to reapply each one, or ignore/remove from the list.

Retain a list of installed, enabled extensions (can discard disabled extensions). Provide a list within the addons page of “extensions you were using before”, where you can install them (similar to the Get Add-ons subsection).

Some automatic part of the API to request that an extension export all its settings. Output it to something the browser can store and copy over, instead of asking user where to save in the file system. When a user re-installs a previously available extension, add an API call to import the provided settings, as optional behavior (eg: re-install this extension; do you want to import previous settings? yes/no).

Oh, and session recovery, like what’s given when a crash occurs, so that you can select which windows and tabs to keep.

Firefox devs should look into a more structured approach to addons/configuration like Nix which allows addons and configuration to be done in an atomic and invertible manner.

A few thoughts:
We have many ways to troubleshoot Firefox problems (1, 2, 3, 4, etc.) . The idea for the reset was to fix as much as possible without troubleshooting. The rationale being, troubleshooting is hard, time-consuming and you’ve already got another browser on your computer that works.

Preferences and add-ons are the two biggest things that users have problems with . So I’d be cautious about limiting it’s effectiveness in these areas or making it more complicated. That said, there got to be something more we can do to make it less painful for power users (migrating tabs was one idea). Maybe there could be an add-on you could run, post-reset, that would automate recovering add-ons and prefs from the old profile (thinking out loud here).

The really big thing I’m still hoping we can do is make this feature more visible. As it is now, people mainly find out about it from visiting the support site (helpful Mozillians and nice blog posts notwithstanding). Bug 750979 would add a reset option for Windows users who are reinstalling the same version of Firefox. In the future maybe it can be included as part of the Firefox Health Report or we could use that information to prompt users to try resetting Firefox.

Thanks for the info. I definitely defer to your experience in terms of what are the major causes of problems.

I finally broke down and did a firefox reset recently. I have had Firefox on this install of Windows 7 since roughly 2010, which I think was Firefox 4 or 5. I had issues with Flash hanging, the browser becoming unresponsive randomly, and a myriad of other issues. My main concern with using the “Reset” was I heavily use the “auto complete” for urls, and have fine tuned it so that I can type 1-3 letters and visit any website I frequent. The description didn’t seem to indicate that this “data” (for lack of a better term) among other small and subtle things I had changed would persist after the Reset. I didn’t care if my history was cleared, or even my saved passwords (which were saved), but I finally gave up and did it (mainly because of Flash hanging constant, and me having to use another browser to watch Youtube).
After having reset, I haven’t noticed any setting differences besides an addon being removed, which I didn’t use it anyways. I’m 100% glad I did the reset because I have not run into any more Flash hangs, or any other issues, and would echo the message of this blog post to anyone with Firefox problems!

As I understand it the “auto complete” is based on your browsing history. So when Reset Firefox says it will preserve “Browsing History and Bookmarks” that covers it. Do you have any suggestions on how this could be made clearer?

Comments are closed.