Bug 105359 - REGRESSION(r137607): PluginDocument loads consume huge amounts of memory
Summary: REGRESSION(r137607): PluginDocument loads consume huge amounts of memory
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nate Chapin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-18 16:01 PST by Nate Chapin
Modified: 2012-12-19 09:39 PST (History)
5 users (show)

See Also:


Attachments
patch (2.77 KB, patch)
2012-12-18 16:06 PST, Nate Chapin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Chapin 2012-12-18 16:01:45 PST
Original report: https://code.google.com/p/chromium/issues/detail?id=166374

To reproduce, go to a plugin that loads as a main resource in a chromium canary (e.g., http://www.scb.se/statistik/_publikationer/NR0001_2012K02_TI_A28TI1203.pdf). That 4MB pdf can easily consume multiple GBs of memory.

The problem is that CachedRawResource implicitly assumes that, if setShouldBufferData() will be called, it will be called before the load starts. PluginDocument calls it after receiving the first chunk of data, which leaves CachedRawResource in an inconsistent state> It ends up sending the entirety of the data received so far in each callback instead of only the incremental data.
Comment 1 Nate Chapin 2012-12-18 16:06:53 PST
Created attachment 180047 [details]
patch
Comment 2 Alexey Proskuryakov 2012-12-19 09:31:09 PST
Comment on attachment 180047 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=180047&action=review

> Source/WebCore/ChangeLog:12
> +        (WebCore::ResourceLoader::setShouldBufferData): shouldBufferData is an enum, not a boolean, so this is reversed.

It's named as a boolean, so it should be renamed.
Comment 3 Nate Chapin 2012-12-19 09:32:36 PST
(In reply to comment #2)
> (From update of attachment 180047 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=180047&action=review
> 
> > Source/WebCore/ChangeLog:12
> > +        (WebCore::ResourceLoader::setShouldBufferData): shouldBufferData is an enum, not a boolean, so this is reversed.
> 
> It's named as a boolean, so it should be renamed.

true

I'll do that in a separate patch.
Comment 4 WebKit Review Bot 2012-12-19 09:39:55 PST
Comment on attachment 180047 [details]
patch

Clearing flags on attachment: 180047

Committed r138174: <http://trac.webkit.org/changeset/138174>
Comment 5 WebKit Review Bot 2012-12-19 09:39:59 PST
All reviewed patches have been landed.  Closing bug.