cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leak observed while using libcURL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Mar 2015 08:30:12 +0100 (CET)

On Sun, 1 Mar 2015, Raja Gopal M wrote:

>> Never? So what happens if you call *cleanup on all easy handles and the
>> multi handle? Is that memory truly lost?

> Calling *cleanup functions does release the memory. Being said that, my
> current application which detected the memory leaks only calls *cleanup
> functions when CURLMSG_DONE for that easy handle is received from libcURL.

Ok, but then I would claim that this isn't a leak but they are simply requests
you start that never complete and therefore keep occupying that memory until
you clean them up.

>> I would say that the connect timeout should be used for that. Isn't it being acknowledged?

> That is the interesting question I have. CURLOPT_CONNECTTIMEOUT is set
> (60seconds) for each of the easy handle being added to the multi handle. I
> read the following line in libcURL documentation, "This only limits the
> connection phase, it has no impact once it has connected"

Ah yes - my gut reaction was wrong here as you do connect fine. It then just
sits waiting to issue its request but it can't do that until the previous
request completes.

You can still set CURLOPT_TIMEOUT of course, or one of the suggestions at
http://curl.haxx.se/docs/faq.html#I_want_a_different_time_out

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-02