From 7198869342eaa1fa285ee25d5c96c7efb2a20984 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 2 Mar 2009 08:33:33 +0000 Subject: [PATCH] More for prev - keep eifree at a reasonable number --- servers/slapd/back-bdb/cache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 1049375735..7d3334935e 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -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 ); -- 2.39.5