Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I mean the second process launch. I startup the process (on Linux, using any version 3.x), it takes 5 seconds to load. Then I kill the process. There is no instance of firefox running. I startup firefox a second or third or forth time... and it always starts very quickly.

My question: why? Are we talking caching of whatever files firefox depends on? Do I need to defragment my hard disk? Is firefox running through various webpages its got cached locally (including its persistent web history)? Or does it cache something in its initialization process (so that the second process launch -- not the second window or tab launch -- note, that isn't the question) that doesn't persist through reboot? Or is there something with caching in other parts of the memory hierarchy?

I could try to find out. But I honestly don't care all that much (it's not like Chrome is available in a stable format with Flash on Linux, afaik). Not being too into the alternatives (opera, or webkit/khtml solutions, etc.), I don't particularly have a choice. Just curious.

share|improve this question

migrated from Oct 6 '09 at 6:22

This question came from our site for professional and enthusiast programmers.

wow, thanks everyone for the really fast answers. makes sense. – Tom Harada Oct 6 '09 at 6:28
If FF loading time is a problem see the add-on MinimizeToTray at – harrymc Oct 6 '09 at 8:11
up vote 8 down vote accepted

Firefox is still cached in RAM, that's what makes it so fast the second time around. If you'd wait a while before starting it the second time it wouldn't be that fast. The same thing happens in Windows and Mac OS X, not just Linux.

share|improve this answer
That's a gross simplification. "Firefox" itself is not cached, but many things it accesses on startup are indeed cached. – Nickolay Oct 8 '09 at 7:11
There was no real point in going into all the details. I know how it works, I've studied this in college. Would you agree with me that the general idea in my answer is valid? – alex Oct 8 '09 at 7:13
Stuff what firefox needs to load is cached, firefox is cached, when you get down to it it answer's the OP's question (they seem to know what they're talking about), and doesn't waste words. +1 – Phoshi Oct 8 '09 at 8:16
Thanks Phoshi for the support :) – alex Oct 8 '09 at 8:42
alex: Sorry, I guess for me the basic answer (something somewhere is cached) is obvious, so I expected the OP to want to know the particulars :) – Nickolay Oct 8 '09 at 11:14

In Linux, unused RAM is wasted RAM so pretty much all recently opened applications are cached exactly for this purpose.

share|improve this answer
It's the same thing in any OS :). – alex Oct 6 '09 at 6:25
in essence every OS does this, but there are several differences in the implementation. that's a larger discussion tho. – Roy Rico Oct 6 '09 at 7:13
It really is a larger discussion. That's why I still have nightmares from my college years :) – alex Oct 6 '09 at 8:14

Some programs use a lot of libraries (dll's) which must be loaded before they can run. After the program terminates, the operating system leaves them in memory in case they might be used again. They will be "flushed out" if others need to load in their place. So yes, this is a form of caching.

Some programs, like Open Office exhibit this behavior, and even come with "quick start" feature which preloads most of the necessary files at startup, even before you run the application.

share|improve this answer

You might be interested in the startup performance work that's underway for Firefox "3.6" (the next after 3.5). This blog has a number of summary posts on this:

share|improve this answer
+1 interesting link. – alex Oct 8 '09 at 7:51

You must log in to answer this question.