Bug 65696

Summary: 7Mb of text takes 450Mb of heap to render
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: amruthraj, ap, bdakin, dbates, hyatt, jamesr, jchaffraix, kling, koivisto, mitz, rniwa, tonikitoo, zalan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[HTML] Snippet
none
[IMAGE] Memory snapshot graph. none

Pavel Feldman
Reported 2011-08-04 09:35:12 PDT
Attached snippet generates 1M lines of text in chunks 50 lines each (<10Mb of data in total). With pretty much nothing in the JS heap, resulting tab takes ~450Mb of heap. Detaching content does not release much memory, repeating the procedure does not go beyond 450Mb though. Sounds like allocating InlineBox takes all the space. I trimmed one bit from the m_expansion to fix alignment (11 -> 10) and it saved ~10% of heap (450->410). Attaching the pprof picture taken after the change.
Attachments
[HTML] Snippet (1.06 KB, text/html)
2011-08-04 09:36 PDT, Pavel Feldman
no flags
[IMAGE] Memory snapshot graph. (90.22 KB, application/postscript)
2011-08-04 09:38 PDT, Pavel Feldman
no flags
Pavel Feldman
Comment 1 2011-08-04 09:36:30 PDT
Created attachment 102934 [details] [HTML] Snippet
Pavel Feldman
Comment 2 2011-08-04 09:38:25 PDT
Created attachment 102935 [details] [IMAGE] Memory snapshot graph.
Pavel Feldman
Comment 3 2011-08-04 09:38:52 PDT
Pavel Feldman
Comment 4 2011-08-04 11:39:41 PDT
Counts: InlineBox 2919865 InlineTextBox 1939910 Sizes (linux 64): sizeof InlineBox 64 sizeof InlineTextBox 88 sizeof RenderObject 56 sizeof RenderText 96 1939910*88 + 2919865*64 = 357583440
Pavel Feldman
Comment 5 2011-08-04 11:40:53 PDT
> 1939910*88 + 2919865*64 = 357583440 k, k, i should not have been adding them up :P
Alexey Proskuryakov
Comment 6 2011-08-04 16:15:19 PDT
We have bug 19986 tracking a similar issue.
Ryosuke Niwa
Comment 7 2016-04-11 02:09:41 PDT
This is no longer the case. Woot! WebContent process now uses only 62MB!
Antti Koivisto
Comment 8 2016-04-11 05:49:40 PDT
This was fixed by simple line layout. We no longer create inline boxes in basic cases like this.
Note You need to log in before you can comment on or make changes to this bug.