Bug 65696 - 7Mb of text takes 450Mb of heap to render
Summary: 7Mb of text takes 450Mb of heap to render
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 09:35 PDT by Pavel Feldman
Modified: 2016-04-11 05:49 PDT (History)
13 users (show)

See Also:


Attachments
[HTML] Snippet (1.06 KB, text/html)
2011-08-04 09:36 PDT, Pavel Feldman
no flags Details
[IMAGE] Memory snapshot graph. (90.22 KB, application/postscript)
2011-08-04 09:38 PDT, Pavel Feldman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 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.
Comment 1 Pavel Feldman 2011-08-04 09:36:30 PDT
Created attachment 102934 [details]
[HTML] Snippet
Comment 2 Pavel Feldman 2011-08-04 09:38:25 PDT
Created attachment 102935 [details]
[IMAGE] Memory snapshot graph.
Comment 3 Pavel Feldman 2011-08-04 09:38:52 PDT
Downstream bug: http://code.google.com/p/chromium/issues/detail?id=89400
Comment 4 Pavel Feldman 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
Comment 5 Pavel Feldman 2011-08-04 11:40:53 PDT
> 1939910*88 + 2919865*64 = 357583440

k, k, i should not have been adding them up :P
Comment 6 Alexey Proskuryakov 2011-08-04 16:15:19 PDT
We have bug 19986 tracking a similar issue.
Comment 7 Ryosuke Niwa 2016-04-11 02:09:41 PDT
This is no longer the case. Woot!  WebContent process now uses only 62MB!
Comment 8 Antti Koivisto 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.