16

I am primarily using Firefox as my web browser. I have noticed that after some tabs having been opened and closed the memory usage of Firefox becomes larger and larger.

This fact often leads me to crash it (deliberately using the task manager) and to open it again selecting only some of the tabs I need. There are cases where I open all my previously open tabs. The funny thing is that even in this case, the memory usage is by far less than what it was before shutting Firefox down.

So my question is why is this happening? Why does the closing of the tabs not help (at least not that much)? Is there a way to reduce the memory usage without shutting Firefox down?

ks1322
  • 459
Eypros
  • 339

4 Answers4

6

Enter about:memory in the address bar. Click 'Minimize memory usage'.

https://support.mozilla.org/en-US/kb/firefox-uses-too-much-memory-ram

5

The first thing I would suspect is that some of plug-ins leak memory or use it a lot.

For example, AdBlock Plus often causes Firefox to increase memory usage significantly. The reason is that it injects large style sheets into every frame. (Ghostery is a more memory-efficient alternative, although it serves a different purpose.)

So, as suggested in the comments, if memory usage doesn't seem reasonable, try disabling all plug-ins and see if this helps.

2

If you need the RAM for other purposes, just restart Firefox. It will minimize it's memory usage, too.

You can even say to Firefox that it does not have to load all pages upon restart:

Firefox button -> Options -> Tabs -> Don't load tabs until selected

Also, I have noticed a high memory usage from Adblock Plus. Adblock Edge does not seem to have this issue. Disabling Adblock Plus also frees memory.

0

RAM cannot be saved for later. Your only choices are to use it or waste it. A system with 8GB of RAM can't use 4GB today in order to use 12GB tomorrow.

So, simply put, Firefox is using more memory because the alternative would be to waste that memory. It is not returning to the initial level because it would take effort to do so and there would be no benefit to expending that effort.

The fact is that firefox sometimes uses upto 2Gb of memory which does not seem reasonable for the number and content of tabs being open.

It's perfectly reasonable if the alternative is to have some of that RAM be wasted and holding no data whatsoever. At a minimum, it allows Firefox to use up to 2GB of memory without having to allocate any more memory, which is a win. Freeing and allocating memory takes effort. Smart systems only expend effort when there's some expected benefit. They certainly don't do work that they'll probably just have to undo later.

Modern operating systems go out of their way to have as little free RAM as possible. Free RAM is forever wasted. If you had 1GB free for the last hour, you gained no benefit whatsoever from that 1GB in that past hour. If you're thinking, "I want that RAM free now so I can use it later", forget it. You can use it now and use it later. There's no painful tradeoff to make here.