From: Howard Chu Date: Wed, 18 Mar 2009 18:18:40 +0000 (+0000) Subject: More for #5860 - if the cache blew past the maxsize, bring it all the way X-Git-Tag: ACLCHECK_0~667 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=65c24bdb1f95d706c25e52f54b78e0be2ebedf36;p=openldap More for #5860 - if the cache blew past the maxsize, bring it all the way back down to size. --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 260623cfa8..66071dccc7 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -674,8 +674,12 @@ bdb_cache_lru_purge( struct bdb_info *bdb ) else eimax = bdb->bi_cache.c_eimax; - if ( bdb->bi_cache.c_cursize > bdb->bi_cache.c_maxsize ) + efree = bdb->bi_cache.c_cursize - bdb->bi_cache.c_maxsize; + if ( efree < 1 ) + efree = 0; + else if (efree < bdb->bi_cache.c_minfree ) efree = bdb->bi_cache.c_minfree; + if ( bdb->bi_cache.c_leaves > eimax ) { eifree = bdb->bi_cache.c_minfree * 10; if ( eifree >= eimax )