WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
281662
Transferring buffers to a closed MessageChannel causes memory leaks in Safari Networking
https://bugs.webkit.org/show_bug.cgi?id=281662
Summary
Transferring buffers to a closed MessageChannel causes memory leaks in Safari...
Ivan Čurić
Reported
2024-10-17 04:10:14 PDT
const { port1, port2 } = new MessageChannel(); port2.close(); port1.postMessage(e.data, [e.data.imageData.data.buffer]); This approach can be used to alleviate memory pressure in V8 as it forces GC. When used in Safari, this memory never gets GC'd, and the leak happens in the "Safari Networking" process for some reason, and can't be reclaimed until you restart Safari. You can't find this leak in the Web Inspector. Repro: Enable the option "Toss transferable to empty MessageChannel" and observe memory usage in Activity Monitor
https://imagedata-worker-leak.netlify.app/
https://github.com/ivancuric/memory-leak-repro
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-10-24 04:11:14 PDT
<
rdar://problem/138550781
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug