cURL / Mailing Lists / curl-library / Single Mail

curl-library

Fwd: When to call curl_multi_clean--Moving to curl-library

From: Naiem Shaik <naiem.shaik_at_gmail.com>
Date: Wed, 10 Sep 2008 15:04:20 +0530

Hi Dan,
I am using curl 7.16.2.
The code I am mentioning is part of WebKit(ResourceHandleManager.cpp).
So I can attach the file and send it if this mailing list allows attachments.
Use case is simple, just opening a page like www.google.com and
exiting the application after page fetch is complete shows there is a
leak in curl_open and curl_connect.
If we continue to fetch more content we see that leak increases in
multiple of 17,120 bytes.

Best Regards,
Naiem

On Wed, Sep 10, 2008 at 11:51:14AM +0530, Naiem Shaik wrote:
> Can any one please let me know what is the correct usage of curl_multi_handle.
> This is the high level logic of webkit=curl interaction
> 1- create a multi handle at the start of program
> 2- keep creating easy handles for each request
> 3- when request is done remove it from multi handle and clean up the
> handle
> 4- multi handle is never released (stays till the end of program)
>
> But as per the documentation we should clean up the multi handle as well.
> So my question is can we re-use the same multi handle without ever
> performing curl_multi_cleanup.
> The reason is we are seeing leak in curl_connect and curl_open with
> this approach.

You can add and remove easy handle to a multi handle as often as you want
without cleaning up the multi handle. There shouldn't be a memory leak
doing this, naturally. Test cases 532 & 533 do something like this and the
curl test harness doesn't show any leaks. What version of the library are
you using? Under what conditions does it leak? Can you show us your
failing code?

Note that this question should really be asked on the curl-library mailing
list instead of here.

>>> Dan

--
http://www.MoveAnnouncer.com              The web change of address service
         Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-09-10