[Webkit-unassigned] [Bug 241750] FileReader.readAsArrayBuffer() Leaks Page Memory

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 19 05:26:55 PDT 2022


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

--- Comment #1 from Dmitry Sharygin <dmitry.sharygin at gmail.com> ---
Webkit Inspector was misleading/indicating a red herring problem in that it was showing page memory increase, but only while the Inspector tool was open and recording the timeline. I did another experiment where I used the file picker to open files many times in a row and only then started recording the timeline in the Inspector - it showed memory to not be elevated.

The actual issue in our app turned out to be caused by code not cleaning up the FileReader event handlers. There were several places where a FileReader was used without cleanup, including an external image resizing library.

There are two area for improvement that I see:

1. Online docs (such as MDN) should be updated to reflect correct FileReader usage - seems like most npm packages out there are not cleaning up the event handlers, which can cause memory leaks over time in long-running applications.
2. Webkit Inspector can be improved by correctly showing the page memory allocation, so that people don't chase after red herrings.

Can the Webkit team please investigate the latter?

-- 
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/20220619/074d94c5/attachment.htm>


More information about the webkit-unassigned mailing list