curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

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

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Thu, 12 Mar 2026 22:54:14 +0100 (CET)

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
Received on 2026-03-12