Skip to content

Commit

Permalink
Merge pull request #6198 from oranagra/skiplist-mem-usage
Browse files Browse the repository at this point in the history
missing per-skiplist overheads in MEMORY USAGE
  • Loading branch information
antirez committed Jul 10, 2019
2 parents c7aaf8d + 41c5ebc commit 7567323
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,9 @@ size_t objectComputeSize(robj *o, size_t sample_size) {
d = ((zset*)o->ptr)->dict;
zskiplist *zsl = ((zset*)o->ptr)->zsl;
zskiplistNode *znode = zsl->header->level[0].forward;
asize = sizeof(*o)+sizeof(zset)+(sizeof(struct dictEntry*)*dictSlots(d));
asize = sizeof(*o)+sizeof(zset)+sizeof(zskiplist)+sizeof(dict)+
(sizeof(struct dictEntry*)*dictSlots(d))+
zmalloc_size(zsl->header);
while(znode != NULL && samples < sample_size) {
elesize += sdsAllocSize(znode->ele);
elesize += sizeof(struct dictEntry) + zmalloc_size(znode);
Expand Down

0 comments on commit 7567323

Please sign in to comment.