[Webkit-unassigned] [Bug 229825] New: Memory Leak when using createImageBitmap() in Safari 15 (iOS)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 2 12:54:04 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=229825

            Bug ID: 229825
           Summary: Memory Leak when using createImageBitmap() in Safari
                    15 (iOS)
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: iPhone / iPad
                OS: Other
            Status: NEW
          Severity: Major
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: wayne.langman at gmail.com
                CC: sabouhallawa at apple.com

Created attachment 437185

  --> https://bugs.webkit.org/attachment.cgi?id=437185&action=review

Code and Screenshots

While testing some of our games in iOS 15 (including the latest beta 8) we encountered some strange behaviour that I've narrowed down to createImageBitmap().

I've investigated this in Instruments, on an iPhone 7 and an iPhone 12, and it appears that the textures aren't being released from memory, which affects not only the current tab but all browser tabs (see the screenshot provided).

Please see the sample code provided which reproduces this issue.

The code will load 30x 2k textures via createImageBitmap(). Depending on your device and how much memory it has, if you open up another 1/2 tabs and load the same demo, and/or continuously refresh, you'll start to notice the occasional flicker of missing, or sometimes black, textures and eventually the tab crashes. Also, whether uploading 1 texture per animation frame or staggered over longer periods the result is the same.

This can be reproduced using the default experimental features but when disabling the canvas rendering process it behaves a little differently (from what I can tell). It may appear at first to resolve the issue but in fact only alleviates the missing/black textures and still leaks memory, eventually crashes the tab.

In our engine we use createImageBitmap() for supported browsers and otherwise use a polyfill (e.g. previous releases of Safari). In the meantime we've implemented a workaround to bypass this on iOS and always fall back to the polyfill. The sample code includes this fallback and does not display any of these issues.

On a side note: I see that createImageBitmap() was added to Safar 11 Technical Preview in November 2017 but am I correct in assuming that it has never actually made its way into release?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210902/df8a080c/attachment-0001.htm>


More information about the webkit-unassigned mailing list