Closed Bug 1150302 Opened 9 years ago Closed 9 years ago

Allow discarding of animated images

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 686905

People

(Reporter: seth, Assigned: seth)

References

Details

Not allowing discarding of animated images creates some nasty side effects.

A case study is the image attached to bug 1150089. It's an animated image that requires well over 1GB of memory to decode, so we eventually run into the SurfaceCache memory limits and run out of memory while trying to decode it. What's unfortunate is that, even if the image is in a background tab, we keep it locked and in memory, preventing other images from being decoded. Even worse: closing the tab isn't enough, because imgIContainer::RequestDiscard() (which we use to free the memory of images when you close a tab) doesn't do anything if the image is locked. To free the memory, you have to close the tab and then wait for the image to eventually expire from the image cache.

Fundamentally, the problem here is that all of the image memory management code is designed around image discarding. When we can't discard an image, especially a *huge* image - which many animated images are - things just don't work smoothly anymore.

In this bug, let's (try to) enable discarding of animated images.
Of course, as soon as I give up and file this bug, I find the original one. =) We'll do this work in bug 686905.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.