[Webkit-unassigned] [Bug 195325] Canvas elements not garbage collected immediately in Safari on iOS 12

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 22 05:09:26 PDT 2022


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

--- Comment #16 from Peter <info at psandtner.sk> ---
Hi Dean,

Thank you for looking into this!

> A. Do nothing - this is expected behaviour [1]. The workaround of setting the canvas size to 0 is probably the best solution.
> Option A is definitely frustrating for developers. I sympathise :disappointed:
None of the other browsers have problem with this, so I’m not sure this is expected behavior. The problem is that not only the canvases no longer referenced anywhere on the page aren’t properly collected (and you could do the workaround here), but mainly, that when you refresh a page the memory still keeps being allocated somewhere. And I haven’t seen this behavior with anything else in Safari, that when you reload a page, the memory for the page that is gone would still be allocated somewhere.

Resetting canvas size is also frustrating to users, because when you’re leaving a page, resetting the canvas size creates a delay and content shift before user is navigated to next page.

We’re able to hit the issue just by rendering our pages generating charts on canvases which render just fine on their own, but when the user navigates between multiple pages (which are full reload, no SPA) that contain canvases, they will hit the memory limit after some time and the canvases then crash.

I made a video showcasing this issue on iPad (6th gen) OS 15.5. You can see at 0:55, after a minute of browsing, the browser is no longer able to allocate canvases.
https://drive.google.com/file/d/1Yz22DSRCHe-OTAAAszId4lZLp_TejKRQ/view?usp=sharing

Happy to hop on a call or provide more minimal reproducible examples if needed.

-- 
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/20220622/e1a039b9/attachment.htm>


More information about the webkit-unassigned mailing list