Bug 22959

Summary: Memory leak in soup during loading & unloading an URL
Product: WebKit Reporter: Dhananjoy Chutia <dhanrd>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Critical CC: ddkilzer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Memory leak fix for soup ddkilzer: review+

Description Dhananjoy Chutia 2008-12-22 01:47:58 PST
Hi,
   I compiled WebKit-r39433 with configuration option --with-target=x11 --with-http-backend=soup. I created a page to refresh at interval of 2000ms with the following source code:

<html>
    <script>
        function callme()
        {
            setTimeout(callme2,2000);
        }

        function callme2() 
        {
            window.location.reload();
        }
    </script>
    <body onload="callme()">
    </body>

</html>

I also observed the VmSize of GtkLauncher and found the following result.

Mon Dec 22 14:10:31 IST 2008
webkit: VmSize:    57348 kB

Mon Dec 22 14:37:31 IST 2008
webkit: VmSize:    58708 kB

I created a patch which shows no leaks for the same above test. I will post it soon.

I have also discussed about these leaks in the following thread:

https://lists.webkit.org/pipermail/webkit-dev/2008-December/006074.html
Comment 1 Dhananjoy Chutia 2008-12-22 02:10:10 PST
Created attachment 26198 [details]
Memory leak fix for soup

Here is my observation for the same test, after applying the patch.

Mon Dec 22 15:01:54 IST 2008
webkit: VmSize:    56972 kB

Mon Dec 22 15:23:54 IST 2008
webkit: VmSize:    56972 kB

It can be seen that there is no leak happened during this test.
Comment 2 David Kilzer (:ddkilzer) 2008-12-22 08:44:10 PST
Comment on attachment 26198 [details]
Memory leak fix for soup

Seems sane and well-tested.  r=me
Comment 3 David Kilzer (:ddkilzer) 2008-12-22 13:22:21 PST
$ git svn dcommit
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/platform/network/soup/ResourceHandleSoup.cpp
Committed r39439

http://trac.webkit.org/changeset/39439