Bug 136347 - WebContent hangs under SharedBuffer::duplicateDataBufferIfNecessary() while browsing some websites
Summary: WebContent hangs under SharedBuffer::duplicateDataBufferIfNecessary() while b...
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: Pratik Solanki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-08-28 12:05 PDT by Pratik Solanki
Modified: 2014-08-28 14:08 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.23 KB, patch)
2014-08-28 12:38 PDT, Pratik Solanki
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Solanki 2014-08-28 12:05:41 PDT
We've got reports of WebContent hangs when browsing some pages. The following two sites have been reported

<http://www.liverpoolway.co.uk/index.php?/forum/1-ff-football-forum/>
<https://sports.yahoo.com/blogs/mlb-big-league-stew/mo-ne-davis-has-rough-outing-in-tough-matchup-with-las-vegas-003922244.html>

The spins show us doing a lot of allocation and memcpy under SharedBuffer::createCFData()

16  WebCore::SharedBuffer::createCFData() + 50 (WebCore + 52722) [0x7fff8fd70df2] 1-16
  16  WebCore::SharedBuffer::data() const + 68 (WebCore + 53780) [0x7fff8fd71214] 1-16
    16  WebCore::SharedBuffer::buffer() const + 36 (WebCore + 53828) [0x7fff8fd71244] 1-16
      16  WebCore::SharedBuffer::duplicateDataBufferIfNecessary() const + 117 (WebCore + 13117829) [0x7fff909e6985] 1-16
        16  WTF::Vector<char, 0ul, WTF::CrashOnOverflow>::operator=(WTF::Vector<char, 0ul, WTF::CrashOnOverflow> const&) + 223 (WebCore + 13118159) [0x7fff909e6acf] 1-16
          16  _platform_memmove$VARIANT$Ivybridge + 49 (libsystem_platform.dylib + 4913) [0x7fff82e76331] 1-16
Comment 1 Pratik Solanki 2014-08-28 12:05:57 PDT
<rdar://problem/18073745>
Comment 2 Pratik Solanki 2014-08-28 12:38:41 PDT
Created attachment 237322 [details]
Patch
Comment 3 Andreas Kling 2014-08-28 13:17:26 PDT
Comment on attachment 237322 [details]
Patch

r=me
Comment 4 Andreas Kling 2014-08-28 13:18:27 PDT
Comment on attachment 237322 [details]
Patch

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

> Source/WebCore/platform/SharedBuffer.cpp:359
> +    size_t newCapacity = std::max(static_cast<size_t>(m_size), currentCapacity * 2);

We could consider a less aggressive growth strategy here, e.g 1.25x instead of 2x.
Comment 5 Pratik Solanki 2014-08-28 14:08:43 PDT
Committed r173080: <http://trac.webkit.org/changeset/173080>