Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Nov 2017 12:49:32 +0100
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        Jan Beich <jbeich@FreeBSD.org>
Cc:        freebsd-ports@FreeBSD.org
Subject:   Re: FireFox memory usage
Message-ID:  <20171104124932.08551078@kalimero.tijl.coosemans.org>
In-Reply-To: <wp39-hiai-wny@FreeBSD.org>
References:  <a891f402-c392-4d2f-fc8d-a397c8d0ab72@netfence.it> <ingk-gjgb-wny@FreeBSD.org> <wp39-hiai-wny@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 01 Nov 2017 21:10:13 +0100 Jan Beich <jbeich@FreeBSD.org> wrote:
> Jan Beich <jbeich@FreeBSD.org> writes:
>> Andrea Venturoli <ml@netfence.it> writes:
>>> I'm on 10.3/amd64 with firefox-esr 52.3.0.
>>>
>>> Since a few days my 4GiB desktop is crawling due to swap usage and
>>> looking at top, I see FireFox using almost 7GiB of RAM (SIZE column),
>>> 2.5 of which are "RES".  
>>
>> Check about:memory and Devolper Tools -> Memory for clues. For more
>> advanced debugging (DMD, Refcount tracing) you'd need a custom build.
>>
>> Firefox on FreeBSD is known to consume more memory than on other
>> platforms because it uses system jemalloc rather than mozjemalloc.
>> Mozilla doesn't test memory usage without mozjemalloc. However, porting
>> mozjemalloc has stalled[1] unless someone helps.
>>
>> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1153683  
> 
> If one is on Firefox 55+ or FreeBSD 12+ while suboptimal compared to
> mozjemalloc the old jemalloc4 optimizations can be restored by
> 
>   $ MALLOC_CONF="narenas:1,tcache:false" firefox ...
> 
> https://dxr.mozilla.org/mozilla-esr52/source/memory/build/jemalloc_config.cpp#35

This appears to be such a huge improvement that you should really put
this in the port even if it's still not as good as mozjemalloc.

You may also want to add the firefox patch attached to bug
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222356.  It reduces
disk I/O, which is a big performance improvement on older systems with
slow disks.  The kernel patches in that bug remove over 90% of the I/O
but not all, and FreeBSD releases don't have those patches yet.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171104124932.08551078>