[SSSD] [PATCH] Do not grow sssd_nss memory footprint
Jakub Hrozek
jhrozek at redhat.com
Tue Oct 23 22:15:16 UTC 2012
Hi,
the attached patch might seem simple, but it touches a delicate and
low-level part of the SSSD, so I'd like to request a detailed review.
I was notified by Bruce Aiesi of the Red Hat QE team that the sssd_nss
process grew its memory footprint when stress-tested by logging in many
users in parallel. I ran a couple of tests and then found out that the
responder context grew because we never freed the internal Data Provider
request. Attached is a patch that simple frees the "side request" after
all the callbacks have been invoked.
I didn't see the memory growth anymore during my testing and I didn't
see any other issues, either during my tests or with valgrind.
I hope I didn't miss any detail and the patch is OK.
-------------- next part --------------
>From 8641191d22d8d33d85bd4432af550742d006c37f Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Tue, 23 Oct 2012 23:25:27 +0200
Subject: [PATCH] Free the internal DP request
---
src/responder/common/responder_dp.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c
index 34fc9f3499f9b9f9f182e2a5a3e90419c6a0cad3..ecd5f39cd2aeb5e46f590a44fd76cf3ead65ac49 100644
--- a/src/responder/common/responder_dp.c
+++ b/src/responder/common/responder_dp.c
@@ -761,4 +761,12 @@ static void sss_dp_internal_get_done(DBusPendingCall *pending, void *ptr)
* This will clean up the hash table entry as well
*/
talloc_zfree(sdp_req);
+
+ /* Free the sidereq to free the rest of the memory allocated with the
+ * internal dp request. */
+ if (ret == EOK) {
+ tevent_req_done(req);
+ } else {
+ tevent_req_error(req, ret);
+ }
}
--
1.7.12.1
More information about the sssd-devel
mailing list