summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2018-06-21 17:36:28 +0200
committerGitHub <noreply@github.com>2018-06-21 17:36:28 +0200
commita16aa03a678d1312611ca601a6f9da68427bba9f (patch)
tree5066d5ea8748471057dffd77c3b56aeae6d896ca
parent1527bcada365231e7d3852bcefc0a8eb0407f5ae (diff)
parent20e10dc7b8eeff9aa5356fd123a7c70e994e6eb4 (diff)
downloadredis-a16aa03a678d1312611ca601a6f9da68427bba9f.tar.gz
Merge pull request #5051 from oranagra/streams_mem_estimate
fix streams memory estimation, missing raxSeek
-rw-r--r--src/object.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/object.c b/src/object.c
index 89166582b..f86d9705a 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);