[Webkit-unassigned] [Bug 146205] Decoding of animated PNG (APNG) is not optimized for memory usage.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 22 09:08:20 PDT 2015


Carlos Alberto Lopez Perez <clopez at igalia.com> changed:

           What    |Removed                     |Added
                URL|                            |http://people.igalia.com/cl
                   |                            |opez/apngmem

--- Comment #1 from Carlos Alberto Lopez Perez <clopez at igalia.com> ---
(In reply to comment #0)
> The current code for decoding animated PNGs (see bug 17022.) decodes all
> frames at once
> and loads the raw pixels on memory for each frame.
> This is a problem when we have an animated PNG with many frames.
> Take the following example:
> http://people.igalia.com/clopez/apngmem
> The image loaded (clouds.png) has 375 frames at 700 x 394 (8-bit/color RGBA),
> so when each frame of this image is loaded into memory it uses:
> 700*394*4 ~ 1.05 MB
> That should be ok if the image had only a few frames, however it has 375
> frames,
> so when we load all the 375 frames into memory we end using around ~400MB,
> which is too much.

I have replaced the previous examples with one that includes the same test with gif and apng because is much clearer the issue.

Now if you load http://people.igalia.com/clopez/apngmem you see there two test pages, the one with gif and the another one with apng.

On the one with gif WebKitWebProcess only uses ~110MB in total, on the one with apng it peaks at ~ 3GB of RAM, and as the animation is playing the memory usage starts to lower (because PNGImageDecoder::clearFrameBufferCache() is starting to clear already played frames), but when the animation finish and it starts again the memory usage peaks again at 3GB of RAM because we load all frames into memory.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150622/de87bdfa/attachment-0001.html>

More information about the webkit-unassigned mailing list