[rescue] Mozilla Firefox

Charles Shannon Hendrix shannon at widomaker.com
Fri Apr 23 15:55:50 CDT 2004


I'm just hijacking this thread to introduce a new on on the geeks
list.  I'm posting to geeks and rescue just to kickstart it.

Please reply to geeks.

Wed, 21 Apr 2004 @ 22:12 -0400, Patrick Giagnocavo +1.717.201.3366 said:

> True.  A long time ago a guy wrote a browser in TCL/TK.  It ran in
> just a few MB of RAM.

I may have figured out one reason why Firefox eats so much memory.  I
think it is a bug in how either it or the Linux kernel handles shared
memory pages.

Running pmap on the main thread, I see dozens of entries like this:

44f2e000    772K read              /SYSV00000000 (deleted)
44fef000    772K read              /SYSV00000000 (deleted)
450b0000    772K read              /SYSV00000000 (deleted)

I assume this is shared memory mappings that are no longer used.
However, instead of the addresses being re-used, they stay in memory
map, gradually increasing VM size.  Unused VM pages get swapped.  Maybe
they never get swapped in again but they do take up swap, and they have
a negative effect on performance.

The total amount of these mappings is around 57MB right now.  That's
57MB of unused VM that ends up eating swap space.

I assume this is shared memory used for communication between threads or
perhaps some library code.  You'd have to look in the sources to know
and right now I can't endure the pain of reading Mozilla code.

This is a five-minute analysis, but anyone else have ideas?  I've even
wondered if this bug is in Mozilla/Firefox, or maybe it is a Linux
bug.  

I have put the full pmap output of my currently running Firefox process
here:

    http://users.757.org/~csh/miscfiles/firefox-pmap.txt

I'm working on a script to track memory use of processes over the long
term to try and determine things like memory high-water marks, average
sizes, etc.

I'm thinking of writing some tools to analyze the memory maps in
Linux, but so far laziness is making a better argument than hubris or
impatience... :)


-- 
shannon "AT" widomaker.com -- ["It's a damn poor mind that can only think
of one way to spell a word." -- Andrew Jackson]



More information about the rescue mailing list