Bug 245230 - [Filters] Limit the memory cost of FilterResults to 100MB
Summary: [Filters] Limit the memory cost of FilterResults to 100MB
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 242219
  Show dependency treegraph
 
Reported: 2022-09-15 10:01 PDT by Said Abou-Hallawa
Modified: 2023-06-01 14:47 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2022-09-15 10:01:03 PDT
Allowing to cache many large FilterImages can cause a memory jetsam. We tried to solve this problem by not applying the filter if the number of filter effects exceeds a certain maximum (currently it is 100).

Instead we should look at the estimated total memory size if we cache all the results. But even if we decide to no cache the result because their memory will exceed a certain maximum (say 100 MB), we should still apply the SVGFilter without caching the results. This may be very inefficient especially with cases where a result FilterImage is used multiple times. Caching it saves time, but we have to regenerate it every time we need it. Of course this is better than not displaying anything for the filtered image.
Comment 1 Radar WebKit Bug Importer 2022-09-15 10:18:10 PDT
<rdar://problem/99975678>
Comment 2 Said Abou-Hallawa 2022-09-15 10:24:30 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4390
Comment 3 EWS 2023-06-01 14:47:42 PDT
Committed 264807@main (93ee37d30632): <https://commits.webkit.org/264807@main>

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