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.
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).
<rdar://problem/87832267>
Created attachment 454563 [details] Patch
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].