From: antirez Date: Mon, 11 Oct 2010 14:46:21 +0000 (+0200) Subject: free memory if the maxmemory parameter is reduced via CONFIG SET X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/b4f2e412d087bae0a523fe6ea40fcad30fe74b5b?hp=--cc free memory if the maxmemory parameter is reduced via CONFIG SET --- b4f2e412d087bae0a523fe6ea40fcad30fe74b5b diff --git a/src/config.c b/src/config.c index 8a5ad6c2..1bd678c7 100644 --- a/src/config.c +++ b/src/config.c @@ -241,6 +241,7 @@ void configSetCommand(redisClient *c) { if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt; server.maxmemory = ll; + if (server.maxmemory) freeMemoryIfNeeded(); } else if (!strcasecmp(c->argv[2]->ptr,"timeout")) { if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0 || ll > LONG_MAX) goto badfmt;