diff options
author | antirez <antirez@gmail.com> | 2012-10-22 10:43:39 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2012-10-22 10:45:55 +0200 |
commit | a25b25f4efb213d44761f8aa5bffc95f266abb2c (patch) | |
tree | 6182e58b2d8a83bfb99377143b662be773b0aee5 | |
parent | ab551808832a9f3097861a706b2c2f57302a3992 (diff) | |
download | redis-a25b25f4efb213d44761f8aa5bffc95f266abb2c.tar.gz |
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
-rw-r--r-- | src/redis.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/redis.c b/src/redis.c index 343b50fc8..ddaa4a621 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; } |