Bug 212201 - [css-grid] WPT test css/css-grid/grid-definition/grid-limits-001.html is very slow and uses too much RAM
Summary: [css-grid] WPT test css/css-grid/grid-definition/grid-limits-001.html is very...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matt Woodrow
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-21 05:26 PDT by Carlos Alberto Lopez Perez
Modified: 2022-03-27 13:25 PDT (History)
13 users (show)

See Also:


Attachments
Patch (12.09 KB, patch)
2022-03-13 20:49 PDT, Matt Woodrow
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2020-05-21 05:26:27 PDT
The WPT test css/css-grid/grid-definition/grid-limits-001.html is very slow when executed in WebKit and uses too much RAM.

Sometimes it even crashes for me with this loud error coming from the WebProcess:

"Unable to shrink memory footprint of process (9248 MB) below the kill thresold (4096 MB). Killed"


The issue its both reproducible, either by running our imported layout test imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-limits-001.html (I'm importing it on bug 212187) or by running the upstream wpt test from https://wpt.live/css/css-grid/grid-definition/grid-limits-001.html

You can see how the tests takes a while to execute (like 10-20 seconds) and the memory usage peaks around 9GB !

This issue its not reproducible with chrome or firefox:

 - with Chrome the test executes quickly, uses few RAM (~250M) but it fails the tests
 - with Firefox the test executes quickly, uses few RAM (~400M) and it passes ok.
Comment 1 Manuel Rego Casasnovas 2020-05-21 06:27:35 PDT
This is somehow expected, given the current memory structure in WebKit:
  typedef Vector<Vector<GridCell>> GridAsMatrix;

For very big grids we create cells for all the nodes and that's too many elements.

In Chromium we use a different memory structure, that we could eventually port into WebKit, but it's not a simple task at all (despite we could re-use most of Blink code for that).
Comment 2 Radar WebKit Bug Importer 2022-01-20 09:10:38 PST
<rdar://problem/87832267>
Comment 3 Matt Woodrow 2022-03-13 20:49:32 PDT
Created attachment 454563 [details]
Patch
Comment 4 EWS 2022-03-27 13:25:13 PDT
Committed r291952 (248919@main): <https://commits.webkit.org/248919@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 454563 [details].