Is firefox constantly eating more and more memory?

Hi there,
I typically like to have multiple firefox windows open in my different virtual desktops.
Typical case is that I leave on Friday with my computer locked and once I am back on Monday I can see the firefox memory consumption being hugely increased. After a fresh reboot firefox needs (for my number of windows 1Gb) while if I leave pc open for days (that I typically do) this increases considerable

  1. How I find that memory consumption is increasing? Through System Monitor tool of my KDE (4.11.5). There is a memory field in the Process tab and when I sort processes by memory firefox is always leading the race. Even if I do not do anything in firefox one can see the memory consumption increasing over time. A bit of fluctuations of course I was expecting as firefox keep reloading advertisements or content. But this is not the case as firefox always increases the memory consumption
  2. I am running firefox
firefox --version

(process:4248): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Mozilla Firefox 27.0.1


  1. and few more info that might help
cat /etc/issue
Welcome to openSUSE 13.1 "Bottle" - Kernel \r (\l).


 uname -a
Linux hidden 3.11.10-7-desktop #1 SMP PREEMPT Mon Feb 3 09:41:24 UTC 2014 (750023e) x86_64 x86_64 x86_64 GNU/Linux


did anyone have a similar problem?

Regards
Alex

I don’t really run any situation such as yours.
But I have mostly moved to Chromium, it’s just much quicker and lighter. For example, just logging in here, takes twice as long with Firefox.
Firefox though does render some sites better for me though, some parts of ebay selling for example.

Hi Alaios

I note you are on Mozilla Firefox 27.0.1, the current version is 30. I would suggest upgrading to the latest version first.

Hi thanks will do (btw I have this problem almost one year now even though I kept updating firefox)

On 2014-06-17 16:26, alaios wrote:
>
> Hi there,
> I typically like to have multiple firefox windows open in my different
> virtual desktops.
> Typical case is that I leave on Friday with my computer locked and once
> I am back on Monday I can see the firefox memory consumption being
> hugely increased. After a fresh reboot firefox needs (for my number of
> windows 1Gb) while if I leave pc open for days (that I typically do)
> this increases considerable

Well, I do not know if FF memory grows while doing nothing, but it
certainly grows with time. Apparently FF can not free the memory it does
not use, even if you close tabs; but eventually, those chunks are
swapped out.

I’d suggest that instead of locking your computer, hibernate it, unless
you really need it running.

A side effect of hibernating is that everything goes to swap, and if not
actually needed, those chunks are not copied to actual RAM on restore.

> - How I find that memory consumption is increasing? Through System
> Monitor tool of my KDE (4.11.5).

The command “top” in a terminal is better for this. Tapping ‘f’ allows
you to add fields; I add the one for “swap”, which I then move to the
right of “SHR”, and ‘W’ saves the config.

Tapping ‘M’ sorts by memory usage. The interesting values are “USED”,
“RES” and “SHR”. You will see that “VIRT” is huge for Firefox, but that
memory is not really used, only reserved somehow.

Eventually, I restart FF, after some days.

> - I am running firefox
> Code:
> --------------------
> firefox --version
>
> (process:4248): GLib-CRITICAL **: g_slice_set_config: assertion ‘sys_page_size == 0’ failed
> Mozilla Firefox 27.0.1
>
>
> --------------------

Same here, but with version 29.0.1 - which means that you need to update.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Hi, can you comment a bit more on this? Why it can not free the memory it does not use? I guess that from software you can always allocate memory (like mallon in c) and then release it back.

I also then guess that also other browsers would have very similar problems.

Alex

I certainly think there is a bug here as this has popped up a few times in the forum, look at this post regarding Xorg Memory leakage and note FF using 2.4gb :

https://forums.opensuse.org/showthread.php/495133-Xorg-Gobbling-Up-Memory-on-openSUSE-13-1-x64?p=2624674#post2624674

What is your Xorg memory use and just out of curiosity what video driver are you using ?

I’m personally using FF 31 beta and the Nvidia binary blob 340.17 (GTX 750 Ti) and have no issues.

On 2014-06-18 07:06, alaios wrote:
>
> robin_listas;2649457 Wrote:
>> …
>>
>> Well, I do not know if FF memory grows while doing nothing, but it
>> certainly grows with time. Apparently FF can not free the memory it does
>> not use, even if you close tabs; but eventually, those chunks are
>> swapped out…
>
> Hi, can you comment a bit more on this? Why it can not free the memory
> it does not use? I guess that from software you can always allocate
> memory (like mallon in c) and then release it back.

This is speculation or somewhat educated guesses; I have seen comments
about it before. If a program (or some types of programs, dunno)
requests many chunks of memory, freeing one sitting in the middle does
nothing practical because it can not be reused, it is too small. If
several non-contiguous chunks are freed, the same happens.

Some programs do their own memory management. They request a big chunk
from the system, then they manage and track smaller chunks internally.
Likewise, freeing chunks in the middle serves little, unless another
chunk that fits inside is requested. But the program could track
internally those chunks and reshuffle them. Some languages implemented
this, I believe (seek “garbage collection”, perhaps). Turbo Pascal did,
somewhat.

That’s the basic idea.

The solution would be to reshuffle those memory blocks, but that is not
that easy, because pointers in the program point to the old sites. You
need an intermediate indirection level, kept by some memory manager: you
suspend the program, resort or unfragment memory, taking care of the
intermediate indirection array, and then let the program continue. The
pointers in the program point to the array, and these point to the new
location, so that the program continues happily, knowing nothing, but
memory has been actually freed.

I do not know if someone/something/somelanguage applies this or similar
trick. It could be done using the segment registers of the processor,
but I was told that Linux uses a linear memory map model, so no.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

You guys tried playing with Firefox’s “about:memory” ?

http://s8.postimg.org/5023xher5/about_memory.jpg](http://postimg.org/image/5023xher5/)

On my computer Firefox is not a problem. I have only 3 GB of RAM but i can use Firefox with 5-8 tabs and other programs without lags.
BTW, I’m waiting for FF 30 in 13.1 & Tumbleweed. When will it be upgraded?

It has been submitted to the Maintenance workflow already and should be released as official update in the next few days.

On 2014-06-18 22:06, Tomoms wrote:
>
> On my computer Firefox is not a problem. I have only 3 GB of RAM but i
> can use Firefox with 5-8 tabs

8 tabs! Wow.
I may have a hundred…

Of course you don’t have a problem. :stuck_out_tongue:


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2014-06-18 20:56, tannington wrote:
>
> You guys tried playing with Firefox’s “about:memory” ?

Nope! That one is new to me. Interesting!

Pity there is not an “about:cpu” page.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

… Give them time :wink:

Even after prolonged use a garbage collection via “about:memory” doesn’t release any appreciable amount… Firefox has grown to include so much “stuff” that it just uses memory like there’s no tomorrow.

:open_mouth: I won’t even think about asking …

You know there’s an “about:about”

I just wanted to thank with all these answers.
I have not updated yet but I have used the about:memory… From there still look likes that the memory consumption increases. The minimize memory consumption button reduces footprint but not that much (it just looks to be a step to delay this memory overkill).

Which would be the preferred repository for updating firefox? Any other packages I should try to change too?

My current repos are:

#  | Alias                              | Name                               | Enabled | Refresh | URI                                                                  
---+------------------------------------+------------------------------------+---------+---------+----------------------------------------------------------------------
 1 | VLC                                | VLC                                | Yes     | No      | http://download.videolan.org/pub/vlc/SuSE/13.1                       
 2 | download.opensuse.org-13.1-non-oss | Update Repository (Non-Oss)        | Yes     | Yes     | http://download.opensuse.org/update/13.1-non-oss/                    
 3 | download.opensuse.org-non-oss      | Main Repository (NON-OSS)          | Yes     | Yes     | http://download.opensuse.org/distribution/13.1/repo/non-oss/         
 4 | download.opensuse.org-oss          | Main Repository (OSS)              | Yes     | Yes     | http://download.opensuse.org/distribution/13.1/repo/oss/             
 5 | download.opensuse.org-update       | Main Update Repository             | Yes     | Yes     | http://download.opensuse.org/update/13.1/                            
 6 | openSUSE-13.1-1.10                 | openSUSE-13.1-1.10                 | Yes     | No      | cd:///?devices=/dev/disk/by-id/ata-HL-DT-STDVD+_-RW_GT30N_KXQA1SB2632
 7 | repo-debug                         | openSUSE-13.1-Debug                | No      | Yes     | http://download.opensuse.org/debug/distribution/13.1/repo/oss/       
 8 | repo-debug-update                  | openSUSE-13.1-Update-Debug         | No      | Yes     | http://download.opensuse.org/debug/update/13.1/                      
 9 | repo-debug-update-non-oss          | openSUSE-13.1-Update-Debug-Non-Oss | No      | Yes     | http://download.opensuse.org/debug/update/13.1-non-oss/              
10 | repo-source                        | openSUSE-13.1-Source               | No      | Yes     | http://download.opensuse.org/source/distribution/13.1/repo/oss/   

Firefox 30 is in the standard update repo already since last Friday.

So just use your desktop’s update applet, YaST->Online Updates, or “zypper patch”/“zypper up”.
No need to add any repos.