Bug 300903
| Summary: | REGRESSION(293871@main): WeChat app allocates large sizes of memory for high resolution images on iOS 26 | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> |
| Component: | Images | Assignee: | Said Abou-Hallawa <sabouhallawa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=291765 | ||
Said Abou-Hallawa
The change 293871@main removes setting the value for the key kCGImageSourceSubsampleFactor in the decoding options. This option is very useful when decoding a high resolution image which will be displayed on a much smaller rectangle. ImageIO decodes the image with a smaller rectangle in this case. This saves memory and CPU time.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/162787553>
Said Abou-Hallawa
Pull request: https://github.com/WebKit/WebKit/pull/52489
Said Abou-Hallawa
Here are other repro steps:
1. On macOS lunch mini-browser or Safari
2. Lunch Activity Monitor to monitor the WebKit allocated memory
3. Open https://upload.wikimedia.org/wikipedia/commons/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg
Result: WebKit allocates about 3GB and it may eventually jetsam and crash
Expected: WebKit allocates about 200-400 MB and it does not jetsam or crash
Note: The size of this image = { 30000 x 23756 }. The memory for decoding this image for its natural size = 30000 x 23756 x 4 = 2.7 GB. But since the window size is much smaller than the natural size of the image, the image should not be decoded for its natural size. This is called image sub-sampling which was dropped by 293871@main.
EWS
Committed 301729@main (c4dc35645e7b): <https://commits.webkit.org/301729@main>
Reviewed commits have been landed. Closing PR #52489 and removing active labels.