Since version 3.0, firefox uses a custom malloc() implementation, called jemalloc (see $URL for more info). The library is correctly installed in /usr/lib64/mozilla-firefox/libjemalloc.so on my system (amd64), but it is not loaded and thus firefox fallbacks to the standard glibc implementation of malloc(). This is demonstrated by inspecting the process's memory map as reported by the kernel. Actual result: # grep jemalloc /proc/$(pidof firefox)/maps [no output] Expected result (obtained with the proposed fix shown below): # grep jemalloc /proc/$(pidof firefox)/maps 7f9df4b7d000-7f9df4b85000 r-xp 00000000 08:03 13704674 /usr/lib64/mozilla-firefox/libjemalloc.so 7f9df4b85000-7f9df4d85000 ---p 00008000 08:03 13704674 /usr/lib64/mozilla-firefox/libjemalloc.so 7f9df4d85000-7f9df4d86000 r--p 00008000 08:03 13704674 /usr/lib64/mozilla-firefox/libjemalloc.so 7f9df4d86000-7f9df4d87000 rw-p 00009000 08:03 13704674 /usr/lib64/mozilla-firefox/libjemalloc.so Proposed fix: Add LD_PRELOAD="/usr/lib64/mozilla-firefox/libjemalloc.so" in the wrapper script (/usr/bin/firefox).
This really needs to be fixed. It helps with memory management substantially.
Firefox 3.5.x no longer installs libjemalloc.so, does anyone know what happened?
libjemalloc.so is linked into final binary.
Yes, in firefox-3.5 jemalloc is built as a static archive which is then linked in the final binary. However this bug is about firefox-3.0* which still has the issue, so I'm reopening.
Removing amd64@g.o from CC. The responsible herd is already assigned here.
everyone on bug report please post emerge -pv mozilla-firefox please.
# emerge -pv mozilla-firefox These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] www-client/mozilla-firefox-3.5.1 USE="dbus java startup-notification -bindist -custom-optimization -gnome -iceweasel -mozdevelop -restrict-javascript" LINGUAS="it -af -ar -as -be -bg -bn -bn_BD -bn_IN -ca -cs -cy -da -de -el -en -en_GB -en_US -eo -es -es_AR -es_CL -es_ES -es_MX -et -eu -fa -fi -fr -fy -fy_NL -ga -ga_IE -gl -gu -gu_IN -he -hi -hi_IN -hr -hu -id -is -ja -ka -kk -kn -ko -ku -lt -lv -mk -ml -mn -mr -nb -nb_NO -nl -nn -nn_NO -oc -or -pa -pa_IN -pl -pt -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -sq -sr -sv -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW" 0 kB (I upgraded to 3.5 when it got unmasked last week, but I kept the USE flags unchanged)
(In reply to comment #7) > # emerge -pv mozilla-firefox > > These are the packages that would be merged, in order: > > Calculating dependencies... done! > [ebuild R ] www-client/mozilla-firefox-3.5.1 USE="dbus java > startup-notification -bindist -custom-optimization -gnome -iceweasel > -mozdevelop -restrict-javascript" LINGUAS="it -af -ar -as -be -bg -bn -bn_BD > -bn_IN -ca -cs -cy -da -de -el -en -en_GB -en_US -eo -es -es_AR -es_CL -es_ES > -es_MX -et -eu -fa -fi -fr -fy -fy_NL -ga -ga_IE -gl -gu -gu_IN -he -hi -hi_IN > -hr -hu -id -is -ja -ka -kk -kn -ko -ku -lt -lv -mk -ml -mn -mr -nb -nb_NO -nl > -nn -nn_NO -oc -or -pa -pa_IN -pl -pt -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -sq > -sr -sv -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW" 0 kB > > (I upgraded to 3.5 when it got unmasked last week, but I kept the USE flags > unchanged) > Invalid, this is about firefox-3.0.x libjemalloc is linked in against final binary of new firefox, any else with this issue that is using firefox-3.0.x please comment soon or bug will be closed invalid. If you are using xulrunner useflag in 3.0.x your libjemalloc comes from xulrunner not firefox.
(In reply to comment #4) > Yes, in firefox-3.5 jemalloc is built as a static archive which is then linked > in the final binary. However this bug is about firefox-3.0* which still has the > issue, so I'm reopening. > I have confirmed that the file is installed when not built against xulrunner, it is installed by xulrunner if xulrunner useflag is enabled bug is invalid.
(In reply to comment #9) > (In reply to comment #4) > > Yes, in firefox-3.5 jemalloc is built as a static archive which is then linked > > in the final binary. However this bug is about firefox-3.0* which still has the > > issue, so I'm reopening. > > > > I have confirmed that the file is installed when not built against xulrunner, > it is installed by xulrunner if xulrunner useflag is enabled bug is invalid. > My firefox-3.0.x had the xulrunner USE flag enabled, libjemalloc.so was installed but wasn't being used. Please explain why this is invalid. (OTOH, I really don't care about this bug anymore since I've upgraded to 3.5 which doesn't have this issue.)