Bug 249947

Summary: Memory leak in firefox on pages with big number of images
Product: [Fedora] Fedora Reporter: denis ivanov <youonly>
Component: firefoxAssignee: Christopher Aillon <caillon>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: fche, mcepl, mcepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: FF3RawhideClose
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-20 16:46:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description denis ivanov 2007-07-28 11:49:11 UTC
Description of problem:

Huge memory used by X server process when firefox open several pages with 100+
images inside (I used locally created pages with photos collection). Even after
firefox closed tabs with this pages, X server still used tons of memory. Only
after full termination of firefox, X server frees memory.

For example now X used 400Mb VIRT/167Mb RES of memory.

Opened 3 pages in tabs each with ~100 of 1024x768 images.

Got more memory used by X (862/535Mb):

 2150 root      20   0  862m 535m 8916 S    2 26.7 127:15.07 X

Closed tabs with that pages. The same result:

 2150 root      20   0  865m 539m 8916 R    6 26.9 127:16.86 X

This is 100% memory leak.

The only way to avoid swapping is full restart of firefox.


Version-Release number of selected component (if applicable):

firefox-2.0.0.4-3.fc8
xorg-x11-server-Xorg-1.3.0.0-15.fc8

How reproducible:

1) Create 5 local html pages with 100 images per page 1024x768 each.
2) Note memory used by X process.
3) Open all 5 pages in firefox tabs.
4) Note memory used by X process.
5) Close firefix tabs.
6) Note memory used by X process.
7) Exit firefox.
8) Note memory used by X process.


Actual results:

Overswap/system down when continuous using of firefox.


Expected results:

Firefox must free memory resources.


Additional info:

Tested same pages under Opera 9. No huge memory used when opened all pages (i.e.
Opera used different way to allocate X server resources?). Also X server
memory's goes lower after closing of Opera's tabs.

Comment 1 denis ivanov 2007-07-28 11:54:48 UTC
Not only X server memory problem. Firefox process leaks too:

189 VIRT/63 RES before open pages

328 VIRT/204 RES after open pages and the same after closing tabs with pages!


Comment 2 Christopher Aillon 2007-07-30 17:10:19 UTC
This is the browser cache keeping things in memory so it is very quick if you
want to go back to the same page you once visited.  If you don't want this, you
can disable the feature.  There are several preferences.  Load up about:config
and search for 'cache' and you can tweak to your liking.

Comment 3 denis ivanov 2007-07-30 21:18:36 UTC
This is bad idea to keep cache for closed tabs!!! Most of users never use "Undo
closed tab" feature. So actually this is memory leak which don't allow continuos
using of firefox when surfing big pages.

So best solution will be cleaning cache for closed tab. IMHO ;)


Comment 4 denis ivanov 2007-08-03 16:57:54 UTC
This bug is *much* deeper.

Have just disabled memory cache (browser.cache.memory.enable=false)

firefox-bin process no more eats huge memory, it's ok

But X process still have problem. I opened 20 pages 100 images each, X grows to
 ~800Mb RES/1200Mb VIRT memory used even after I closed all tabs in browser!

Maybe there is some tool to view X resources allocated by process?
Seems firefox just not free some resources.


Comment 5 Matěj Cepl 2007-12-20 16:46:52 UTC
We just updated the Firefox version in Fedora/development from 2.0 to a 3.0
pre-release version, which improves performance, memory usage, and fixes many
bugs and crashes.

Closing as CANTFIX since we aren't fixing bugs filed against 2.0 now that 3.0 is
in.  If this bug is still present in rawhide using a Firefox 3.0 version, please
re-open this bug.

Thanks and Happy Holidays