Re: Memory Leak?
Date: Wed, 9 Oct 2002 14:11:19 +0200 (MET DST)
On Tue, 8 Oct 2002, Brian Feaver wrote:
(Cross-posted to the libcurl list, please take follow-ups there, this is a
> I'm currently using version 7.10. I'm using cURL to download images from a
> webserver continuously and then save them to disk. Everytime I want a new
> image, I call curl_easy_perform (from inside an infinate loop). Here's a
> snipit of my code:
> // Open file for writing
> jpgFile = fopen(jpgPath,"w");
> res = curl_easy_perform(curl);
> jpgFile = NULL;
> I have also tried putting all my cURL calls into its own function
> (including a call to curl_easy_cleanup) and then just looping the funciton
> call. Both of these ways cause the process to increase it's memory size.
> This is the only part that repeats and therefor it can't be leaking
> anywhere else.
> Any suggestions or hints would be appreciated.
I really need to write down a proper How To Track Down libcurl Memory Leaks
document, but until I have, read this:
If you just make sure your program have an exit point, you can for example
let it download the document N number of times and then cleanup and exit,
then the above instructions are perfect to detect exactly where in libcurl
the allocation is made that was never freed.
And if none is found in libcurl, the leak is in your code!
-- Daniel Stenberg -- curl related mails on curl related mailing lists please ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sfReceived on 2002-10-09