Bug 256837

Summary: Memory leak in compression stream to blob conversion
Product: WebKit Reporter: Jozef <32jojo32>
Component: DOMAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: brandonstewart, cdumez, mark.lam, webkit-bug-importer, youennf, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
example none

Description Jozef 2023-05-16 06:23:58 PDT
Created attachment 466360 [details]
example

Safari uses enormous amount of memory and eventually crashes when using new CompressionStream API with response.blob(). 

Open this page and click the button. Open memory monitor and you will see enormous increase in RAM consumption. I tested the same code in Chrome and I was not able to see any notable memory change detected.

https://gist.github.com/Joozty/250d0d76c2af273ebfc953883c0e47e4
Comment 1 Radar WebKit Bug Importer 2023-05-16 09:30:49 PDT
<rdar://problem/109409251>
Comment 2 Brandon 2023-05-16 10:28:12 PDT
@Jozef Thanks for the test case; I am able to reproduce.
Comment 3 Brandon 2023-05-16 14:13:48 PDT
Did some debugging today, and we are holding on to several references that should be getting freed.
Comment 4 youenn fablet 2023-05-23 05:46:52 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14239
Comment 5 EWS 2023-05-23 23:55:08 PDT
Committed 264462@main (37e5346e6e28): <https://commits.webkit.org/264462@main>

Reviewed commits have been landed. Closing PR #14239 and removing active labels.