Image Discarding does not work until tabs have been touched at least once.

RESOLVED FIXED in Firefox 4.0b8



Tabbed Browser
8 years ago
8 years ago


(Reporter: The 8472, Assigned: bz)



Firefox 4.0b8
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking2.0 betaN+)



(2 attachments)



8 years ago
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101128 Firefox/4.0b8pre
Build Identifier: 

As discussed in bug 598466 comment 72 image.mem.discardable does not actually start discarding image memory on tabs that have not been touched after startup. On larger sessions this means a large amount of uncompressed image data needlessly stays in memory.

Reproducible: Always

Steps to Reproduce:
1. Create a session with many image-heavy tabs
2. restart firefox
3. watch images/content/used/uncompressed going up in about:memory
4. ctrl+tab through all tabs to visit them at least once
5. see how memory usage suddenly goes down


8 years ago
Blocks: 598466
This seems bad....
blocking2.0: --- → ?
Ever confirmed: true


8 years ago
Version: unspecified → Trunk
I would guess this has to do with the fact that docshells are active by default unless set otherwise. We probably need to set isActive to false on all the background tabs during session restoration.
Hmm.  Why does addTab only set isActive = false in the !blank case?
Session restore always adds as about:blank, then does the real load.

Comment 5

8 years ago
Who's the right person to fix this?
blocking2.0: ? → betaN+
Version: Trunk → unspecified

Comment 6

8 years ago
Why are we decoding those images at all? Will setting isActive=false on the docshell cause us to avoid doing any image decoding until we switch to the tab?
(In reply to comment #6)
> Why are we decoding those images at all? Will setting isActive=false on the
> docshell cause us to avoid doing any image decoding until we switch to the tab?

If we enable decode-on-draw, yes. See bug 573583. Should just be a pref flip...

Sorry I'm not more available to drive this stuff. :\ Joe, what's your timeframe on imagelib stuff?
Created attachment 494164 [details] [diff] [review]
Make all new tabs not active by default, not just those with a non-blank url.
Attachment #494164 - Flags: review?(
Using a 70-tab testcase based on bug 598466 comment 13 on 64-bit mac, I see private bytes usage around 920MB without this patch, and around 770MB with this patch.
Assignee: nobody → bzbarsky
Component: ImageLib → Tabbed Browser
Product: Core → Firefox
QA Contact: imagelib → tabbed.browser
Whiteboard: [need review]
And I did verify that without the patch most of the tabs have docshells that are isActive, and with it they're not.
Attachment #494164 - Flags: review?( → review+
Attachment #494184 - Attachment description: testcase → test
Comment on attachment 494184 [details] [diff] [review]

Attachment #494184 - Flags: review?(bzbarsky) → review+

Gavin, thanks for the test!
Last Resolved: 8 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [need review]
Target Milestone: --- → Firefox 4.0b8

Comment 14

8 years ago
Memory usage on startup is down too in the latest nightly, looks good.


8 years ago
Keywords: footprint
You need to log in before you can comment on or make changes to this bug.