MCPcopy Create free account
hub / github.com/F-Stack/f-stack / updateMaxmemory

Function updateMaxmemory

app/redis-6.2.6/src/config.c:2253–2264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2251}
2252
2253static int updateMaxmemory(long long val, long long prev, const char **err) {
2254 UNUSED(prev);
2255 UNUSED(err);
2256 if (val) {
2257 size_t used = zmalloc_used_memory()-freeMemoryGetNotCountedMemory();
2258 if ((unsigned long long)val < used) {
2259 serverLog(LL_WARNING,"WARNING: the new maxmemory value set via CONFIG SET (%llu) is smaller than the current memory usage (%zu). This will result in key eviction and/or the inability to accept new write commands depending on the maxmemory-policy.", server.maxmemory, used);
2260 }
2261 performEvictions();
2262 }
2263 return 1;
2264}
2265
2266static int updateGoodSlaves(long long val, long long prev, const char **err) {
2267 UNUSED(val);

Callers

nothing calls this directly

Calls 3

zmalloc_used_memoryFunction · 0.85
performEvictionsFunction · 0.85

Tested by

no test coverage detected