WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
260925
Use of many shadow trees with unique style triggers significant CPU usage and a rise in process size
https://bugs.webkit.org/show_bug.cgi?id=260925
Summary
Use of many shadow trees with unique style triggers significant CPU usage and...
Kin Blas
Reported
2023-08-30 14:33:49 PDT
Created
attachment 467500
[details]
HTML file that illustrates the performance degradation and rise in memory. Press the Test button and watch the process size grow. In our web application we've noticed a significant rise in process memory after showing and hiding DOM UI subtrees made up of a large number of custom elements that utilize style tags that refer to CSS custom properties. In Safari 16.5 as well as WebKit
267464@main
, the attached test case can start out consuming about 44 MB but after a few iterations, the process size can jump up to 1.6 GB or more. A GC or something will eventually kick in and the process size will drop back down to the 100 MB range, but then the process size will slowly climb back up again to the 1 GB range. As memory grows, performance also degrades significantly to the point where rendering stops happening, and you'll see occasional flashes of the content being shown.
Attachments
HTML file that illustrates the performance degradation and rise in memory. Press the Test button and watch the process size grow.
(6.08 KB, text/html)
2023-08-30 14:33 PDT
,
Kin Blas
no flags
Details
Video demonstrating what we see when running the test case.
(26.62 MB, video/quicktime)
2023-08-30 14:59 PDT
,
Kin Blas
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Kin Blas
Comment 1
2023-08-30 14:59:42 PDT
Created
attachment 467501
[details]
Video demonstrating what we see when running the test case. Attaching a quick video that shows what we see when running the test case.
Radar WebKit Bug Importer
Comment 2
2023-08-30 16:41:38 PDT
<
rdar://problem/114731415
>
Antti Koivisto
Comment 3
2023-10-09 08:21:21 PDT
The slowness here is caused by
bug 262891
.
Antti Koivisto
Comment 4
2023-10-09 08:26:34 PDT
The memory growth appears to be a separate issue from that. In trunk it can go over 1GB but at some point it drops down to ~150MB range. I suspect this behavior is GC related.
Antti Koivisto
Comment 5
2023-10-10 03:05:13 PDT
The reason for memory growth is that the style resolver sharing cache in Style::Scope has unlimited size and the test case keeps adding more items there. Low memory handler clears the cache causing memory use to eventually drop.
Antti Koivisto
Comment 6
2023-10-10 03:16:45 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/18889
EWS
Comment 7
2023-10-10 08:23:40 PDT
Committed
269142@main
(b3c5d420be05): <
https://commits.webkit.org/269142@main
> Reviewed commits have been landed. Closing PR #18889 and removing active labels.
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