diff --git a/src/evict.c b/src/evict.c index cdb49a551..39deb65a6 100644 --- a/src/evict.c +++ b/src/evict.c @@ -364,7 +364,7 @@ size_t freeMemoryGetNotCountedMemory(void) { } } if (server.aof_state != AOF_OFF) { - overhead += sdslen(server.aof_buf)+aofRewriteBufferSize(); + overhead += sdsalloc(server.aof_buf)+aofRewriteBufferSize(); } return overhead; } diff --git a/src/object.c b/src/object.c index 7c98a6ef3..2e2ebee21 100644 --- a/src/object.c +++ b/src/object.c @@ -1011,7 +1011,7 @@ struct redisMemOverhead *getMemoryOverheadData(void) { mem = 0; if (server.aof_state != AOF_OFF) { - mem += sdslen(server.aof_buf); + mem += sdsalloc(server.aof_buf); mem += aofRewriteBufferSize(); } mh->aof_buffer = mem;