HYIP-Man: insane memory usage of firefox
Friday, August 14, 2009
insane memory usage of firefox
Sandro Tosi: My dear iceweasel,:

WTH are you doing with all this memory?
 $ top -b -n 1 | egrep "xulrunner|PID" 
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3907 morph
20 0 2349m 859m 15m S 14 21.7 2013:33 xulrunner-stub
say goodbye, you're going to die; mew


Matthew Palmer: Oh Firefox...

What are you doing in that the 1.1GB of resident memory (1357m of virtual memory) you have decided to consume in order to display three web pages? All fairly basic pages -- no flash, no excessive Javascript, and I haven't even done anything particularly exciting in the browser -- just loaded the pages up and let them sit for a few days.

Time to look at Conkeror on the Netbook, I suppose. I'm unlikely to be needing Firebug on there any time soon



Enrico Zini: Firefox garbage collection:

Some people complained about the insane memory usage of firefox.
It must be a misunderstanding. They probably are not aware of how to trigger the excellent garbage collector shipped with the browser.

Let's navigate heavily a bit, opening several new tabs, click click click around, then closing those tabs:

 $ top -b -n 1 | egrep "firefox|PID"   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM
TIME+ COMMAND
6842 enrico 20 0 882m 398m 17m S 2 19.9 24:29.55 firefox-bin

Indeed Firefox memory usage quickly grew. I've seen it grow to a gigabyte and a half after keeping it open for a month.

Now let's trigger the garbage collector:

 $ kill -9 6842 $ # Rerun firefox $ # Click on "Restore previous session"
$ # Wait for the various open tabs to reload

And voilĂ ! Now Firefox uses much less memory than before:

 $ top -b -n 1 | egrep "firefox|PID"   PID USER
PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5242 enrico
20 0 656m 205m 25m S 0 10.3 0:14.49
firefox-bin

Labels: ,