cURL / Mailing Lists / curl-library / Single Mail


SSL certificates and increasing memory usage

From: Jerry Blakley <>
Date: Mon, 19 Aug 2013 15:49:37 -0700

Our fusedav filesystem client uses cURL and nss. We create a thread, open a
session handle (curl_easy_init), keep it open for many connections
(curl_easy_perform), and close it when the thread ends (curl_easy_cleanup).
Each call to curl_easy_perform eventually makes the following calls

(in nss.c)
cert_stuff (because we do not use certificate nicknames)
and so on

The comment in nss_create_cert indicates:
/* Call PK11_CreateGenericObject() with the given obj_class and filename.
 * the call succeeds, append the object handle to the list of objects so
 * the object can be destroyed in Curl_nss_close(). */

Curl_nss_close won't get called until curl_easy_cleanup.

What seems to be happening is that while the session is open and the
connection reused, we make the repeated allocations in nss_create_object,
increasing memory usage, until the session ends and curl_easy_cleanup is

Is this the case, and should it be so? Or is there/should there be some
intermediary cleanup routine, or an ability to reuse the certificate
information without the reallocation?


List admin:
Received on 2013-08-20