From 65c24bdb1f95d706c25e52f54b78e0be2ebedf36 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 18 Mar 2009 18:18:40 +0000 Subject: [PATCH] More for #5860 - if the cache blew past the maxsize, bring it all the way back down to size. --- servers/slapd/back-bdb/cache.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ) -- 2.39.5