From a25b25f4efb213d44761f8aa5bffc95f266abb2c Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 22 Oct 2012 10:43:39 +0200 Subject: [PATCH] Default memory limit for 32bit instanced moved from 3.5 GB to 3 GB. In some system, notably osx, the 3.5 GB limit was too far and not able to prevent a crash for out of memory. The 3 GB limit works better and it is still a lot of memory within a 4 GB theorical limit so it's not going to bore anyone :-) This fixes issue #711 --- src/redis.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/redis.c b/src/redis.c index 343b50fc..ddaa4a62 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1329,11 +1329,11 @@ void initServer() { /* 32 bit instances are limited to 4GB of address space, so if there is * no explicit limit in the user provided configuration we set a limit - * at 3.5GB using maxmemory with 'noeviction' policy'. This saves - * useless crashes of the Redis instance. */ + * at 3 GB using maxmemory with 'noeviction' policy'. This avoids + * useless crashes of the Redis instance for out of memory. */ if (server.arch_bits == 32 && server.maxmemory == 0) { - redisLog(REDIS_WARNING,"Warning: 32 bit instance detected but no memory limit set. Setting 3.5 GB maxmemory limit with 'noeviction' policy now."); - server.maxmemory = 3584LL*(1024*1024); /* 3584 MB = 3.5 GB */ + redisLog(REDIS_WARNING,"Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with 'noeviction' policy now."); + server.maxmemory = 3072LL*(1024*1024); /* 3 GB */ server.maxmemory_policy = REDIS_MAXMEMORY_NO_EVICTION; } -- 2.47.2