Date:  24 Nov 2015 11:15:52 Hong Kong Time

Re: MemShrink Triage (17th Nov 2015)


On Tuesday, November 17, 2015 at 4:44:58 PM UTC-8, Eric Rahm wrote:
> 1157546 - Core :: Layout - Track visibility of all frames

This one I'm mainly nominating because it enables a bunch of other things that will help improve our memory story. The most important example is bug 1218990, discussed below, but this change will be the foundation for much more fine-grained policies about memory management of images and other content - for example, we might discard images in background tabs more aggressively if they're outside of the viewport, or we might prioritize images that are near the viewport over images that are merely in the displayport (i.e., the APZ rendering area) when memory is low.

> 1218990 - Core :: Layout: Images - Lock CSS images only when visible

So right now we cannot discard images referenced by CSS (except if the page is backgrounded); once a CSS image gets decoded, it stays in memory. This has proven severely problematic on the B2G Gallery app (partially for this reason we had to modify it to remove most CSS images) and will cause very high memory usage on any long-scrolling page that displays images using CSS. By contrast, content images (e.g. the  element) are discarded when they get too far from the viewport (and enough time has passed), so memory usage is much more controlled.

This bug is about giving us the same behavior for CSS images that we currently have for content images - once they are too far from the viewport, a timer starts that will discard them if they go too long without being used.

In my opinion this one of the two most serious image-related memory issues that remain in Firefox. (The other being the fact that we can't discard animated images, which I hope to fix in Q1.)

Hopefully all of this explains why I've nominated these two bugs as P1.

- Seth