]> git.saurik.com Git - redis.git/blobdiff - src/config.c
Object approximated LRU algorithm enhanced / fixed / refactored. This is used for...
[redis.git] / src / config.c
index 8a5ad6c2bc8cd6d0671b2194dad057d23ae7ac7f..1bd678c783050927f662f99e1a78df9ede38d771 100644 (file)
@@ -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;