Hi - wanted to see if anyone has any thoughts on how to minimize browser 
memory usage on nevada, in particular Mozilla 1.7+ and Firefox 1.5+

Problem
--------
Problem is that in a multi user thin client environment on a Solaris 10 
system we are seeing Mozilla 1.7 and Firefox in particular eat huge 
amounts of RAM. Having Firefox with heap size of over 100Megs is quite 
common. You see the private memory consumption grow as you open more 
tabs, but when you close the tabs little if any heap is freed. As an 
experiment just:
$pmap -x `pgrep firefox-bin` | grep total - 4th column is the private 
memory for the process.
Navigate to 
http://images.google.ie/images?q=car&hl=en&btnG=Search+Images and then 
close the tab
$pmap -x `pgrep firefox-bin` | grep total

bash-3.00$ pmap -x `pgrep firefox-bin` | grep total <- after navigating 
to above page
total Kb   88848   45972   12804       -
bash-3.00$ pmap -x `pgrep firefox-bin` | grep total <- after closing 
tab, memory goes up :(
total Kb   88848   45972   12812       -

I've checked on the various forums and there's a lot of talk about it.

Known Memory Issues
---------------------
Check out bugzilla with the mlk keyword and you can see what I mean:
https://bugzilla.mozilla.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content=mlk
73 Memory Leak Open Bugs

There is a leak tool to help file memory leak bugs at:
Please file good memory leak bugs, part 2 (09:45 -0800)
http://dbaron.org/log/2006-01#e20060110a

And there is a FAQ on all of the current Firefox memory issues:
The one and only "Memory usage" thread & FQA
http://forums.mozillazine.org/viewtopic.php?t=354828

Heap compacting - some of the posts mention that Firefox is freeing 
memory, but it's not being reclaimed by the OS. Could we change this 
behaviour by using a different memory allocator on Solaris - libumem ? 
http://developers.sun.com/solaris/articles/libumem_library.html
Started to check out memory leaks using Jonathan Adams libumem 
recommendations in: 
http://www.opensolaris.org/jive/thread.jspa?threadID=6009&tstart=0
Following the above guidelines, loaded libumem, then I launched Firefox 
and navigated to the image page. Got my core and examined it in mdb. I 
found a few leaks but only around 12k. Firefox's heap size went from:
Startup with Google home page: 31088 -> Navigate to Image and search for 
"car" 39064 -> Close Tab with images 39088
So in general it would appear not to be leaking (or not too badly), but 
the heap is not shrinking, i.e memory going back to the OS ?? What's up?

Minimize - seemed that minimizing earlier versions of Firefox caused the 
memory cache to be flushed and memory to be freed up. This no longer 
happens in 1.5.0.1. Seems there is a Minimize to Tray extension for 
Windows OS that helps here but not on Solaris, also setting the 
about:config config.trim_on_minimize allows Windows to aggresively 
reclaim memory, this is not meant to have any effect on Unix, haven't 
tested it.

Have Browser keep Compressed Images in the Client: Frederico from Novell 
and Gnome land had a proposal to store images used by the browser in 
compressed format to improve memory consumption [problem getting to the 
original page, using cached page: 
http://72.14.203.104/search?q=cache:saoQ5MXVoO0J:primates.ximian.com/~federico/news-2005-11.html+Proposal+to+reduce+the+memory+consumption+of+images+in+Mozilla+&hl=en&gl=ie&ct=clnk&cd=1]

"When you run *Mozilla* or Firefox and load a web page with *images*, it 
stores the uncompressed *images* as pixmaps in the X server 
<https://bugzilla.mozilla.org/show_bug.cgi?id=259672>. In particular, it 
seems to maintain live pixmaps for /all/ the *images* in /all/ the tabs 
that you have open; even if a tab is not visible, the *images* will be 
in your X server's *memory*."
"For Firefox, keeping the compressed, as-downloaded *images* in the 
client could *reduce* *memory* *consumption* a lot. "
"For the proof-of-concept program, we reduced the cumulative *memory* 
usage from *108063 KB* to *19588 KB* -- that is, a factor of 5.5."

Tweaks for now in a multi user environment:
---------------------------------------
http://www.tweakguides.com/Firefox_8.html
http://kb.mozillazine.org/About:config_entries
Note these entries can be added to the user.js/ prefs.js file in the 
users .mozilla dir, when the browser and email clients are closed, or 
else just navigate to about:config in the browser to access the settings.

Download Manager: seems to be pretty resource hungry when you get a 
large history and setting it to clear out the history on successful 
download is recommended, particulary for long running sessions [can set 
it to clear out on browser exit if you want - 1]
/browser. download. manager. retention: 0/* -* Upon successful download 
remove download entry from history

/browser.cache.memory.enable:/ true /
browser.cache.memory.capacity/: 4096 [4 Meg - default is 32 Meg]
Could disable it but really effects usability, as most of the caching is 
of the chrome used to display Firefox itself.
Check out you memory cache: about:cache?device=memory

Browser back and forward page cache, introduced in 1.5, seems to be a 
real memory hog though it should only be caching up to a max of 8 pages.
/browser.sessionhistory.max_total_viewers/: 0  - disable bfcache

Browser Session History - maximum number of pages in the browser's 
session history:
/browser. sessionhistory. max_entries: 15/ - default is 50

Reduce redraw noise, stop flashing of the Download Manager's taskbar 
entry when the DM is not in the foreground.
/browser. download. manager. flashCount: 0 - disable
/Use of the blink tag disabled.
/browser. blink_allowed: False -/ Blinking is disabled.

Extensions:
Be very careful what's allowed here as lots of the common ones seem to 
leak like sieves. Refer to:
http://forums.mozillazine.org/viewtopic.php?t=354828#2051115
Also using FasterFox and Firefox Preloader can also eat up memory, 
depending on the settings chosen, see above link.

If you suspect extensions are causing you problems you can disable all 
extensions by starting firefox in safe-mode:
/usr/sfw/bin/firefox -safe-mode

Plugins:
Java and Adobe can use up lots of memory. Plugins are not unloaded after 
use. Use
Adobe Reader 7.0.5 and Java Runtime Environment 1.5.0_06

Opera
------
Opera apparently does a few sensible things such as freeing memory for 
images on tabs that are not visible. I checked out the Opera site but 
only saw a build for Sparc - anyone got a package for x86? Would be 
interesting to compare it to Firefox on x86.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.opensolaris.org/pipermail/desktop-discuss/attachments/20060321/54035415/attachment.html>

Reply via email to