curl / Mailing Lists / curl-users / Single Mail


Re: Memory increase with https requests

From: Daniel Stenberg <>
Date: Fri, 4 May 2018 14:10:15 +0200 (CEST)

On Fri, 4 May 2018, madana gopal wrote:

> We are using curl version 7.35 and 7.40 in our project and running in linux.
> When we make https requests via *curl_easy_perform()* call, there is a
> regular memory increase of process VIRT and RAM sections seen from top
> command. Amount of memory increase is based on number of https requests
> made. *curl_easy_cleanup() *call is made at the end of every request.
> Memory increase is not seen with http requests.
> Please let me know, do we have any issues related to this already and there
> is some standard way to make curl calls for https requests.If there is a
> known patch for this, please share the same. We may not want to upgrade the
> curl package at this moment, but can apply the patch.

It is not surprising that HTTPS uses (much) more memory than plain HTTP. The
added TLS layer requires a fair amount of memory.

You're using fairly old versions of libcurl and we've fixed many bugs since
then, but I can't recall any significant memory leak in any of those version
that would make the memory use continue to grow unbounded. The memory use you
see is most likely perfectly fine, expected and will all be freed when your
application exits. You can of course use memory debugging tools such as
valgrind to verify this if you want to.

Finally: you seem to be using libcurl, so you might want to consider the
curl-library mailing list if you want to dive into libcurl details.

Received on 2018-05-04