From 5e8a4c12f9617d7e7b2c392eddc1ced613a561fe Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 17 Jun 2007 05:19:30 +0000 Subject: r23528: Two changes to make the valgrind massif (heap profiler) output readable: Remove the allocated inbuf/output. In async I/O we copy the buffers explicitly now, so NewInBuffer is called exactly once. This does not reduce memory footprint, but removes one of the larger chunks that clobber the rest of the massif output In getgroups_unix_user on Linux 2.6 we allocated 64k groups x 4 bytes per group x 2 (once in the routine itself and once in libc) = 512k just to throw it away directly again. This reduces it do a more typical limit of 32 groups per user. We certainly cope with overflow fine if 32 is not enough. Not 100% sure about this one, a DEVELOPER only thing? (This used to be commit 009af0909944e0f303c5d496b56fb65ca40a41d5) --- source3/lib/system_smbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib') diff --git a/source3/lib/system_smbd.c b/source3/lib/system_smbd.c index 8159f3a3b5..ffdd8eeed0 100644 --- a/source3/lib/system_smbd.c +++ b/source3/lib/system_smbd.c @@ -154,7 +154,7 @@ BOOL getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user, gid_t *groups; int i; - max_grp = groups_max(); + max_grp = MIN(32, groups_max()); temp_groups = SMB_MALLOC_ARRAY(gid_t, max_grp); if (! temp_groups) { return False; -- cgit