Merge pull request #6198 from oranagra/skiplist-mem-usage

missing per-skiplist overheads in MEMORY USAGE
This commit is contained in:
Salvatore Sanfilippo 2019-07-10 19:43:24 +02:00 committed by GitHub
commit 7567323071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);