From 20e10dc7b8eeff9aa5356fd123a7c70e994e6eb4 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Thu, 21 Jun 2018 17:58:29 +0300 Subject: [PATCH] fix streams memory estimation, missing raxSeek --- src/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/object.c b/src/object.c index a77f2aed..d17f9d1f 100644 --- a/src/object.c +++ b/src/object.c @@ -745,7 +745,7 @@ char *strEncoding(int encoding) { * size of a radix tree that is used to store Stream IDs. * * Note: to guess the size of the radix tree is not trivial, so we - * approximate it considering 128 bytes of data overhead for each + * approximate it considering 16 bytes of data overhead for each * key (the ID), and then adding the number of bare nodes, plus some * overhead due by the data and child pointers. This secret recipe * was obtained by checking the average radix tree created by real @@ -904,6 +904,7 @@ size_t objectComputeSize(robj *o, size_t sample_size) { * structures and the PEL memory usage. */ raxIterator cri; raxStart(&cri,cg->consumers); + raxSeek(&cri,"^",NULL,0); while(raxNext(&cri)) { streamConsumer *consumer = cri.data; asize += sizeof(*consumer);