Changeset 91600 in webkit


Ignore:
Timestamp:
Jul 22, 2011, 1:17:44 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

DocumentLoader keeps a reference to all URL strings ever loaded in m_resourcesClientKnowsAbout leading to lots of memory waste
https://bugs.webkit.org/show_bug.cgi?id=61894

Patch by Scott Graham <scottmg@chromium.org> on 2011-07-22
Reviewed by James Robinson.

DocumentLoader::m_resourcesClientKnowsAbout is a set of all the URLs
that have passed through FrameLoader::dispatchWillSendRequest() and is
used by FrameLoader::loadedResourceFromMemoryCached to decide whether
to inform the FrameLoader's m_client about this load. Unfortunately,
this set holds a reference to the URL string for every resource
loaded, so on pages that use data URLs to "load" large amounts of data
this leaks lots of memory. The cache improves performance going through
FrameLoader::loadResourceFromMemoryCache, so rather than removing it,
simply exclude 'data:' urls from the cache to save the majority of
memory that is held for too long.

  • loader/DocumentLoader.h:

(WebCore::DocumentLoader::didTellClientAboutLoad):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r91599 r91600  
     12011-07-22  Scott Graham  <scottmg@chromium.org>
     2
     3        DocumentLoader keeps a reference to all URL strings ever loaded in m_resourcesClientKnowsAbout leading to lots of memory waste
     4        https://bugs.webkit.org/show_bug.cgi?id=61894
     5
     6        Reviewed by James Robinson.
     7
     8        DocumentLoader::m_resourcesClientKnowsAbout is a set of all the URLs
     9        that have passed through FrameLoader::dispatchWillSendRequest() and is
     10        used by FrameLoader::loadedResourceFromMemoryCached to decide whether
     11        to inform the FrameLoader's m_client about this load.  Unfortunately,
     12        this set holds a reference to the URL string for every resource
     13        loaded, so on pages that use data URLs to "load" large amounts of data
     14        this leaks lots of memory. The cache improves performance going through
     15        FrameLoader::loadResourceFromMemoryCache, so rather than removing it,
     16        simply exclude 'data:' urls from the cache to save the majority of
     17        memory that is held for too long.
     18
     19        * loader/DocumentLoader.h:
     20        (WebCore::DocumentLoader::didTellClientAboutLoad):
     21
    1222011-07-22  Alok Priyadarshi  <alokp@chromium.org>
    223
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r91583 r91600  
    231231        void didTellClientAboutLoad(const String& url)
    232232        {
     233#if !PLATFORM(MAC)
     234            // Don't include data urls here, as if a lot of data is loaded
     235            // that way, we hold on to the (large) url string for too long.
     236            if (protocolIs(url, "data"))
     237                return;
     238#endif
    233239            if (!url.isEmpty())
    234240                m_resourcesClientKnowsAbout.add(url);
Note: See TracChangeset for help on using the changeset viewer.