Title: [91600] trunk/Source/WebCore
Revision
91600
Author
commit-qu...@webkit.org
Date
2011-07-22 13:17:44 -0700 (Fri, 22 Jul 2011)

Log 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 <scot...@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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91599 => 91600)


--- trunk/Source/WebCore/ChangeLog	2011-07-22 20:04:56 UTC (rev 91599)
+++ trunk/Source/WebCore/ChangeLog	2011-07-22 20:17:44 UTC (rev 91600)
@@ -1,3 +1,24 @@
+2011-07-22  Scott Graham  <scot...@chromium.org>
+
+        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
+
+        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):
+
 2011-07-22  Alok Priyadarshi  <al...@chromium.org>
 
         Use software rendering for small canvas

Modified: trunk/Source/WebCore/loader/DocumentLoader.h (91599 => 91600)


--- trunk/Source/WebCore/loader/DocumentLoader.h	2011-07-22 20:04:56 UTC (rev 91599)
+++ trunk/Source/WebCore/loader/DocumentLoader.h	2011-07-22 20:17:44 UTC (rev 91600)
@@ -230,6 +230,12 @@
         
         void didTellClientAboutLoad(const String& url)
         { 
+#if !PLATFORM(MAC)
+            // Don't include data urls here, as if a lot of data is loaded
+            // that way, we hold on to the (large) url string for too long.
+            if (protocolIs(url, "data"))
+                return;
+#endif
             if (!url.isEmpty())
                 m_resourcesClientKnowsAbout.add(url);
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to