File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1095,6 +1095,16 @@ void initServer() {
1095
1095
}
1096
1096
}
1097
1097
1098
+ /* 32 bit instances are limited to 4GB of address space, so if there is
1099
+ * no explicit limit in the user provided configuration we set a limit
1100
+ * at 3.5GB using maxmemory with 'noeviction' policy'. This saves
1101
+ * useless crashes of the Redis instance. */
1102
+ if (server .arch_bits == 32 && server .maxmemory == 0 ) {
1103
+ redisLog (REDIS_WARNING ,"Warning: 32 bit instance detected but no memory limit set. Setting 3.5 GB maxmemory limit with 'noeviction' policy now." );
1104
+ server .maxmemory = 3584LL * (1024 * 1024 ); /* 3584 MB = 3.5 GB */
1105
+ server .maxmemory_policy = REDIS_MAXMEMORY_NO_EVICTION ;
1106
+ }
1107
+
1098
1108
if (server .cluster_enabled ) clusterInit ();
1099
1109
scriptingInit ();
1100
1110
slowlogInit ();
You can’t perform that action at this time.
0 commit comments