40-60% of startups are warm?

Note: click on the images if they get clipped by other content. Cold startups are those where data has to be read in from disk, warm ones are subsequent startups where the OS already has Firefox files in memory.

I’m really surprised by the amount of warm startups done by Firefox users. Somewhere between 40% to 60% of startups are warm. On Linux you can see that by watching whether pagefaults occur while loading the firefox binary via EARLY_GLUE_STARTUP_HARD_FAULTS histogram.

On Windows we do not have a good metric  for distinguishing cold startups from warm ones. However can look at the distribution of firstpaint histogram and see that faster startups are more common than slower ones. Only a small minority of machines should be able to cold start a browser in <3 seconds.  We have a lot of startups of various degrees of warmness.

I have no explanation on why people restart Firefox so much. We know < 10% of our shutdowns are unclean (most of those appear to be due to OS shutdown not waiting on Firefox, ie us shutting down too slowly) so users aren’t crashing their browser and starting again. They are voluntarily closing the browser and then starting it soon after (ie OS doesn’t get a chance to flush Firefox out of filesystem cache).

These patterns are pretty consistent across all of the Firefox release channels I checked, so I can’t blame warm startups on nightly users getting barraged with upgrade prompts. Can someone come up with a good theory(preferably with some evidence) for this?

Note telemetry only collects data once a day and requires the browser to be open for a few minutes before submitting data, data could be skewed here.

32 comments

  1. At my work, a fair few people will load up IE/Firefox, check Facebook etc then close out of it, especially since it loads very fast from warm now.

    I would assume a number of installs would be at places like internet cafes or a publicly used PC.

    As people are getting used to the mobile way e.g. loading an app briefly then closing it when done – I say this would indicate a usual case. I don’t know many people who leave Firefox open for days on end.

  2. I am running FF 14 (beta channel) and I usually restart Firefox about once a day due to sluggishness of the UI.
    This generally happens once memory (as per task manager) climbs over 500-600MB.
    At that point FF will become less responsive to keyboard and mouse, page loading, etc doesn’t seem to be affected too much, though.

  3. For me I only restart firefox when I get prompted to do so by upgrade (2 machines on beta/alpha channels). However reading comments around the interwebz some people restart firefox whenever it uses up memory/slows down.

  4. Personally I use e4rat with preloading on Linux, so even my cold starts are warm ;)

  5. I’m using tree style tab addon and most of the time I’m having 15+ tabs open, but during one session I only use few of them. The first X tabs are just reminders of things I was busy with or still need to check in the next few days. After a long day surfing I notice my GCs are going up and therefor the response of the browser is getting slower. Therefore I sometimes just close the browser and reopen it to reduce GC times. (The reduction is twofold, 1: all objects that couldn’t get GC’ed but are actually not used are gone, 2: all tabs are restored but not loaded, so less objects to GC over)

  6. On top of the reasons noted:

    – Addons install/updates.

    – Firefox updates (especially for the nightly/aurora channels, but also if the sample coincided with a release version update).

    – Free up resources: I sometimes close Firefox when I open applications which use a lot of CPU/RAM (games, virtual machines, etc). Many machines still have 2-4G ram or less, so it can be useful.

    Also, for machines with relatively much RAM and long uptime (possibly common with recent generation machines), it’s very possible that Firefox is started few times on each reboot, which can be fast.

  7. I start up and shut down many times a day. It has nothing to do with memory leaks or stability. I simply prefer to close apps when I’m not using them and there is no context lost by closing them. Typically I have just three to five items on my windows task bar at any given time.

    I have a modern, fast, quad-core CPU with 8GB of RAM, and starting up FF is quick enough that it is not a hindrance.

  8. I restart Firefox multiple times a day to make it more responsive again (aging computer + lots of firebug makes it slow).

    I’ve watched Windows users restart Firefox multiple times, and it’s because they close Firefox when they’re done with the webpage. Then 10 seconds or a minute later when they want to open another page they open Firefox again. OSX keeps Firefox running on close, so if this theory is correct, you should see less warm starts in OSX.

  9. does EARLY_GLUE_STARTUP_HARD_FAULTS work on BSD as well?

  10. @user it comes from getrusage, which is posix, so yes.

  11. I usually have to restart my Firefox every few days when the resident size leaks its way up to that point where CC pauses exceed one second in duration. (It used to be around 2GiB, but Aurora 15 seems to push it closer to 3iB)

    In theory, I’d love to help track down which of my dozens of extensions (most for little warts like making Firefox switch tabs on scroll-wheel like every other GTK+ application and browser on my system does by default) are leaking but, in practice, even a binary search is too big a commitment for me, given how long it takes to leak its way up there.

  12. several times a day i start browsing “the news” (rss), open 20-60 tabs, go thru (most?) them, and after that close and often restart firefox right after, or within couple of minutes.

    i learned this behavior once session restore became reliable, but it was probably reinforced in the last year or two when firefox had lots of problems with memory.

    today, i think i mostly do it out of habit, and i’m pretty sure it’s not really necessary anymore. but i got accustomed to take those kinds of breaks, both mental and physical ones (coffee, water, eat, walk), and think that must be the main reason today..

  13. > They are voluntarily closing the browser and then starting it soon after

    Hi, I do that a lot. It just feels natural to start a new window whenever I’m doing “a new thing”.

    I could do that as opening of new window and closing the old one (no restart) but old window gets covered so it’s clunky.

    So I do the opposite: close old window and start a new one. Whether this leads to a process restart depends on background windows, but is transparent to my workflow.

    NB: as you can guess, current new download manager UI annoys me to no end because it makes process restarts no longer transparent.

  14. Normally, I would restart Firefox to flush its excess memory usage, but it seems like things might have improved as of Firefox 10.0.5.

  15. I frequently close windows when I’m done with them — on Windows XP that meant often closing Firefox.

    Now that I use a Mac, this happens a lot less, since I have to consciously choose to close Firefox.

  16. Over a period of years, users have been trained to close Firefox to keep it from bogging down.

  17. “I have no explanation on why people restart Firefox so much.”

    I, for one, don’t keep my applications running if I’m not actively using them. So if I’m not browsing the web, Firefox is not running. My machine only has 1GB of RAM so keeping both Firefox and Tunderbird open all the time (2 of my most open applications) is not an option if I’m doing something else.

    On an entirely different note, is anyone within the Snappy project looking at Firefox’s behavior when behind an HTTP proxy? My work machine is a beefy i7 with 16GB of RAM and yet, I get various UI freezes which I do not get at home without a proxy. Food for thoughts. :)

    Cheers

  18. I run Aurora and generally keep it open at all times… so I restart it pretty much only when I get an update, which happens a lot on Aurora. Presumably telemetry is also skewed towards Aurora/Nightly users?

  19. Many non-proficient users hit the “red cross in the top right corner” when they want to move on to something else, even if to just get back to their homepage. I’m pretty sure you could get meaningful insight about this using test pilot. Have you been in touch with these folks?

  20. I run BOINC on my machine, so unused processor cycles aren’t wasted. To increase the number of unused processor cycles I turn off all programs I have running when I leave the machine for a longer period of time (>=15 min). That’s probably not long enough to have the cache flushed given that nothing else but BOINC is using the machine.

  21. For me it’s that the browser slows down over time and I hope/expect to do less restarts once (incremental) GC changes and Kyle Huey’s reference cutting fix hit Release.

  22. Benedikt P. [:Mic]

    I’m usally closing my browser window when I’m not actively using it + if there’s no background activity like playing a radio stream or such stuff.

  23. Doesn’t seem like a mystery to me. Depends on the users behaviour but it all leans the same way.

    Those that leave Firefox running: will have to restart Firefox on a daily basis in order to keep it snappy. I know I’m in this category.

    Those that start Firefox when they need it and then close it: on Vista and 7 Superfetch will preload frequently started applications into RAM so the start is quick. Vista and 7 users represent ~50% of Firefox users, I’m guessing, and if Superfetch is working they should seldom see cold starts.

    Those that don’t use Firefox as their main browser but just fire it up to check something: they are the kind of power-user that is more likely to have an SSD.

  24. It is the default behaviour of Firefox to shut down when the last tab is closed. I guess people unintentionally hit that frequently.

  25. as many others I close firefox when I don’t need it anymore, even if a few minutes later I need it again. I like to close everything isn’t doing useful work. Also when I open a game I’m afraid it would consume too much GPU memory.

  26. “Note telemetry only collects data once a day and requires the browser to be open for a few minutes before submitting data, data could be skewed here.”

    No wonder u cannot gather useful telemetry data if u send it only once a day, and many ppl close the session and go for dinner etc, then after few mins go back as “AV” said before.

    As “Remi” said: “I, for one, don’t keep my applications running if I’m not actively using them. So if I’m not browsing the web, Firefox is not running” so.. u dont get telemetry data, since its send while afk so to say.
    Many ppl, dont like to have many apps open at same time, they use one, close, use another then open Fx again. Thats why Chrome’s fast start is so apreciated by people. I see at work and at home that users behave that way. Thats the way it is. Point.
    There could be other reason as well, like closing browser at work, even with saved session, to not allow others see that ur browsing, and since we have tabs on demand feature, starting Fx again is not as painful as it was in the past(but could be better…).
    Users (inexperienced or just those who look for fast info, who dont need long browsing sessions) like to open browser quickly, find what they want and close the app even if they start it again for someting in next 5 minutes. Fast start is crucial

  27. I remember having a similar discussion with Alex Faaborg. UX/UR had found out that a lot of people, especially on Windows, use the red X to close Firefox when they’re done with a particular page and then reopen it for a new page, sometimes immediately. In fact, he suggested at time to keep the Firefox process around for a few seconds after you close the last window to make this behaviour a better experience.

  28. I also close applications that I don’t need any longer even if I use them again 30min later.

  29. Christopher Antila

    I’m a little surprised nobody’s said this so far, but I restart Firefox many, many times a day for security/privacy reasons. I also turn off my computer when I’m not using it, which perhaps puts me in the minority amongst people commenting here.

    Certainly it’s not a reason shared with too many people, but my browser and add-on settings are such that (I hope) all website-related data are obliterated after restarting. Thus, when I switch to or from a task of greater or lesser sensitivity, like news to banking and back, I make sure to restart Firefox.

    When your only perspective is from yourself and people like you (Mozilla community members), it’s hard to know why people do things… So TestPilot and blog posts like this one are very important. Thanks!

  30. It seems that many people will use the browser like you and I might use a calculator.
    Open it, do something, close it.
    Then go do something IRL or use a different application.
    I’ve seen this when observing some of my less technical friends. The browser simply doesn’t get left open.

  31. Just a comment to vote :
    + 1 for preload on linux, nightly updates and addons
    + Sadly (even if GC perf increased really fast those past months) +1 for hangs after hours of use (especially when firebug is/has been enabled).

    I would add :
    + addons tests (not updates).
    + When addons mess up my config (restart in safe mode).
    + crashes of nightly (quite rare those times).

    + Ctrl+q instead of Ctrl+s :$

    An opinion poll to vote would be nice after so much differents answers. :)

  32. My Windows box has been running for 65 days straight at this point, so Fx has several reboots. Probably at least once a week for various reasons including Flash update, AddOn update, Fx update, Excessive memory usage and so on.