]> git.sur5r.net Git - openldap/commitdiff
More for prev - keep eifree at a reasonable number
authorHoward Chu <hyc@openldap.org>
Mon, 2 Mar 2009 08:33:33 +0000 (08:33 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 2 Mar 2009 08:33:33 +0000 (08:33 +0000)
servers/slapd/back-bdb/cache.c

index 1049375735e166164d6bd181b603f8f0a9fbb709..7d3334935ef5de8cfcd1f216069ab47474d43f48 100644 (file)
@@ -673,8 +673,11 @@ bdb_cache_lru_purge( struct bdb_info *bdb )
 
        if ( bdb->bi_cache.c_cursize > bdb->bi_cache.c_maxsize )
                efree = bdb->bi_cache.c_minfree;
-       if ( bdb->bi_cache.c_leaves > eimax )
+       if ( bdb->bi_cache.c_leaves > eimax ) {
                eifree = bdb->bi_cache.c_minfree * 10;
+               if ( eifree >= eimax )
+                       eifree = eimax / 2;
+       }
 
        if ( !efree && !eifree ) {
                ldap_pvt_thread_mutex_unlock( &bdb->bi_cache.c_lru_mutex );