Samba 2.0.7 mem leaks, continued

Teemu Junnila (QRA) Teemu.Junnila at era.ericsson.se
Tue Sep 19 09:45:13 GMT 2000


Too bad but I had to backout the patch. Especially W2000 clients began to have major problems accessing the user-profiles we synchronise to the server (in H:, mapped as home directory).
I blew up my own profile totally, I had to pull the files back from a backup.

Thanks anyway,
/Teemu

-----Original Message-----
From: Jeremy Allison [mailto:jeremy at valinux.com]
Sent: den 14 september 2000 21:00
To: acherry at pobox.com
Cc: Teemu Junnila (QRA); 'samba-technical at samba.org'
Subject: Re: Samba 2.0.7 mem leaks, continued


acherry at pobox.com wrote:

> Since the dbx leak checking I did seemed to point to the
> hash_table_init() function in lib/hash.c, I did some poking around to
> see what the problem was.  At least one problem is that there's a
> hash_clear() function to free up the memory used by a table, but it
> never gets referenced anywhere. :-) Send the smbd daemon enough HUP
> signals and this will become noticeable as the old stat_cache is
> thrown away each time (more noticeable in the long run).
> 
> I've gotten around this by running hash_table_clear(&stat_cache) in
> smbd/filename.c just before running hash_table_init().  But even after
> doing that, the smbd daemon process still seemes to be gaining about
> 8K per hour (though an improvement over before)... I'm not yet sure
> where that memory is going -- I haven't been able to reproduce it in a
> test environment, and I want to keep the testing/experimentation off
> of our production server.

Ok - can you try this patch for 2.0.7 which is what we have added
to 2.2.0 to fix the statcache problems. Let me know if it fixes
things.

Thanks,

	Jeremy Allison,
	Samba Team.

Index: smbd/filename.c
===================================================================
RCS file: /data/cvs/samba/source/smbd/filename.c,v
retrieving revision 1.19.2.3.2.3
diff -u -r1.19.2.3.2.3 filename.c
--- smbd/filename.c     2000/03/16 22:59:44     1.19.2.3.2.3
+++ smbd/filename.c     2000/09/14 18:57:18
@@ -734,5 +734,13 @@
  */
 BOOL reset_stat_cache( void )
 {
-  return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE, (compare_function)(strcmp));
+       static BOOL initialised;
+       if (!lp_stat_cache()) return True;
+
+       if (!initialised) {
+               initialised = True;
+               return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE, (compare_function)(strcmp));
+       }
+       hash_clear(&stat_cache);
+       return True;
 } /* reset_stat_cache  */                               
-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------




More information about the samba-technical mailing list