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
Radar WebKit Bug Importer
Comment 1 2024-10-24 04:11:14 PDT
Note You need to log in before you can comment on or make changes to this bug.