ImageContainer will always contain 100 decoded images when the parent element is hidden

RESOLVED INVALID

Status

()

RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: jya, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox47 affected)

Details

(Reporter)

Description

3 years ago
The issue was noticed while investigating bug 1237160.

The media element's ImageContainer will drop images only in the following two circumstances:
1- A new image has been composited, and that image was newer than images currently held by the ImageContainer. All images older than this image will be dropped. https://dxr.mozilla.org/mozilla-central/source/gfx/layers/ImageContainer.cpp#358
2- When new images are added to the ImageContainer, the images that haven't been composited yet will be dropped if there are more than 100 images in the FIFO queue. This is done in https://dxr.mozilla.org/mozilla-central/source/gfx/layers/ImageContainer.cpp#218

If a media element is hidden, none of its images will ever be painted, so 1) won't occur.

Due to the eviction policy for 2), it means that as the element is playing in the background, we will always have at least 100 images in ImageContainer::mFrameIDsNotYetComposited

As the drop of images occurs only once new images are added, if the video stopped playing and is hidden, the remaining 100 images will never be dropped until the element becomes visible again.

100 raw images can amount to a fairly significant amount of memory.
(Reporter)

Updated

3 years ago
See Also: → bug 1222308
(Reporter)

Comment 1

3 years ago
oops silly me, only the ID is kept, an int. not the image.

time for bed.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
Whiteboard: [MemShrink:P2]
You need to log in before you can comment on or make changes to this bug.