cURL / Mailing Lists / curl-library / Single Mail

curl-library

memory leak? help needed

From: Tom Jerry <catod6_at_gmail.com>
Date: Thu, 12 Oct 2006 01:21:00 +0200

Hello,
I'm using the multi interface in libcurl 7.15.5 and my application memory is
leaking.
I suspect libcurl, since most of my other memory allocations are static.

The main flow of my application contains repeatedly POST requests .
In my 1st thread, I get a request to POST data, so I initialize my easy
handle using easy_setopt and add the easy handle to the multi.
In my second thread I use a loop (like in the demo) with select,
multi_perform and multi_info_read. Once a http request is finished, I notify
the 1st thread about it.
(of course I synchronize the access to the multi handle from both threads).

In order to make sure it's libcurl, I used the curl_global_init_mem function
with my own memory callbacks, and added a counter.
Printing the counter regulary, I see the memory keeps growing.

Now that I'm pretty sure it's within libcurl, I want to know how to analyze
the internal memory.
I believe there is a -D flag I should turn on and compile.
Can someone direct me to a place explaining how to investigate libcurl
memory?

thak you,
Ori.
Received on 2006-10-12