Why Redis used extra more 0.4G memory for storing strings? #1199

Open
andybrier opened this Issue Jul 17, 2013 · 1 comment

Projects

None yet

2 participants

@andybrier

My Data structure is simple k-v. the key is very simple, like "k0, k1...k1000",but the each value's length is 1MB. I totally put 1024 k-v pairs. use "info" command, i got:

Memory

used_memory:1520854344
used_memory_human:1.42G
used_memory_rss:1068912640
used_memory_peak:1522938872
used_memory_peak_human:1.42G
used_memory_lua:31744
mem_fragmentation_ratio:0.70
mem_allocator:jemalloc-3.2.0

why redis used "1.42G" memory? I supposed the used memory would be nearly 1GB

@kgcrom

include sizeof(struct sdshdr) +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment