summaryrefslogtreecommitdiff
path: root/src/zmalloc.h
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2019-05-30 12:51:32 +0300
committerOran Agra <oran@redislabs.com>2019-06-02 15:33:14 +0300
commit09f99c2a925a0351985e799c106614082d6053cf (patch)
tree7fe3fe8c7fa499a70111fb6ce18dae37a95e3977 /src/zmalloc.h
parent2fec7d9c6c630db3bcb13a07a08c39404abad447 (diff)
downloadredis-09f99c2a925a0351985e799c106614082d6053cf.tar.gz
make redis purge jemalloc after flush, and enable background purging thread
jemalloc 5 doesn't immediately release memory back to the OS, instead there's a decaying mechanism, which doesn't work when there's no traffic (no allocations). this is most evident if there's no traffic after flushdb, the RSS will remain high. 1) enable jemalloc background purging 2) explicitly purge in flushdb
Diffstat (limited to 'src/zmalloc.h')
-rw-r--r--src/zmalloc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/zmalloc.h b/src/zmalloc.h
index 6fb19b046..b136a910d 100644
--- a/src/zmalloc.h
+++ b/src/zmalloc.h
@@ -86,6 +86,8 @@ size_t zmalloc_used_memory(void);
void zmalloc_set_oom_handler(void (*oom_handler)(size_t));
size_t zmalloc_get_rss(void);
int zmalloc_get_allocator_info(size_t *allocated, size_t *active, size_t *resident);
+void set_jemalloc_bg_thread(int enable);
+int jemalloc_purge();
size_t zmalloc_get_private_dirty(long pid);
size_t zmalloc_get_smap_bytes_by_field(char *field, long pid);
size_t zmalloc_get_memory_size(void);