[webkit-dev] Curl resourcehandle leaks in Linux/Gtk port

zaheer ahmad zaheer.mot at gmail.com
Wed Sep 10 00:56:30 PDT 2008


hi,

In the linux Gtk port, with Webkit revision 33493, i see that the resource
handles (curl backend) never get released after completing the data transfer
for that request. This results in big leaks in resourcehandles as well as
the curl internal data structures. (~800k on opening nytimes.com and closing
the connection)

The reason is that the ResourceHandle ref count never drops to 0, resouce
loaders drop their refcount correctly, but the ref done by the Resource
handle onitself  (source below) before handing over to the resourcehandle
manager is not matched with a deref.

ResourceHandleCurl.cpp:
bool ResourceHandle::start(Frame* frame)
{
    ASSERT(frame);
    ref();
    ResourceHandleManager::sharedInstance()->add(this);
    return true;
}

The fix that works is to deref in the ResourceHandleManager::removeFromCurl
however we do not know the impact. Brief look at the latest code doesnt seem
to have changed this much, however i can still verify on it.

BTW why does handing resourcehnadle to resourcehandlemanager need to be
protected, i guess a weak pointer would do. Also i dont see this done in
other ports + gtk/soup though the interfaces are different.

thanks in advance for any inputs.

regards,
Zaheer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webkit.org/pipermail/webkit-dev/attachments/20080910/1dde6d80/attachment.html 


More information about the webkit-dev mailing list