Re: Does performing the curl_easy_init and curl_easy_cleanup thousands of times increases the memory footprint of the process when observed using top command in linux

Daniel Stenberg via curl-library <[email protected]> Thu, 12 Mar 2026 22:54:14 +0100 (CET)
Newsgroups gmane.comp.web.curl.library
Message-ID <[email protected]>
On Thu, 12 Mar 2026, Sasmit Utkarsh via curl-library wrote:

> I'm trying to write a program which uses which uses in libcurl handles in 
> multithreaded manner. i.e transfer/make a http post request every 10 secs 
> using the libh2o event-loop powered by libuv worker threads. But what i see 
> is when I clear the handle once done with the request. I see that memory 
> footprint of the process increases in top. is there any better approach 
> sharing the sample code for review

1. The code looks... questionable with threads and globals and possible memory 
leaks.

2. Is valgrind happy? If valgrind is happy then I think you're good.

3. That was too much code for me too review for fun.

-- 

  / daniel.haxx.se || https://rock-solid.curl.dev
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html