From d552fd01e125d0a15a1b092dd4f1a26ac9814eb7 Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 14 Jul 2023 14:39:09 -0400 Subject: [PATCH] Fix OOM issues during full sync when fork bgsave is used (#209) --- src/evict.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evict.cpp b/src/evict.cpp index 740a6d2b2..1523b2814 100644 --- a/src/evict.cpp +++ b/src/evict.cpp @@ -427,7 +427,7 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev size_t maxmemory = g_pserver->maxmemory; if (fPreSnapshot) maxmemory = static_cast(maxmemory*0.9); // derate memory by 10% since we won't be able to free during snapshot - if (g_pserver->FRdbSaveInProgress()) + if (g_pserver->FRdbSaveInProgress() && !cserver.fForkBgSave) maxmemory = static_cast(maxmemory*1.2); /* If available system memory is below a certain threshold, force eviction */