Tweak image discard heuristics to make us less likely to throw out images we've decoded recently




6 years ago
6 years ago


(Reporter: justin.lebar+bug, Unassigned)



Firefox Tracking Flags

(Not tracked)


We suspect that part of what was causing bug 744309 was that we were over-eager to discard images (perhaps when we ran up against the hard N-byte decoded images limit).

I have perhaps a direct fix for bug 744309, but I think we can also protect ourselves by tweaking the discard heuristic.

The goal is to be able to set a harder limit on the amount of decoded image data we willingly keep around.  Right now, it's set to 250MB, but I'd like to lower that, particularly on B2G.
Thinking about heuristics here...

This is actually a lot like awesomebar frecency, except at a much smaller timescale.  If an image has been discarded frequently and recently, then we should be unwilling to discard it again.  OTOH if an image has been discarded infrequency, or not recently, we should be willing to discard it again.

Jesse and I developed some (somewhat involved) math for doing frecency at [1].

Maybe this is overkill...I'm not quite sure yet.

You need to log in before you can comment on or make changes to this bug.