summaryrefslogtreecommitdiff
path: root/src/zmalloc.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-03-24 12:00:20 +0100
committerantirez <antirez@gmail.com>2014-03-24 12:00:20 +0100
commit93253c27620647deb3cb60e2666fbf7db9eff4cb (patch)
treee502e4e0707bc148c289f1b18723e74be72d170c /src/zmalloc.h
parent30639c8ca957b3ece9985d8261f89b4494494886 (diff)
downloadredis-93253c27620647deb3cb60e2666fbf7db9eff4cb.tar.gz
Sample and cache RSS in serverCron().
Obtaining the RSS (Resident Set Size) info is slow in Linux and OSX. This slowed down the generation of the INFO 'memory' section. Since the RSS does not require to be a real-time measurement, we now sample it with server.hz frequency (10 times per second by default) and use this value both to show the INFO rss field and to compute the fragmentation ratio. Practically this does not make any difference for memory profiling of Redis but speeds up the INFO call significantly.
Diffstat (limited to 'src/zmalloc.h')
-rw-r--r--src/zmalloc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zmalloc.h b/src/zmalloc.h
index 331d8e433..72a4f8138 100644
--- a/src/zmalloc.h
+++ b/src/zmalloc.h
@@ -73,7 +73,7 @@ char *zstrdup(const char *s);
size_t zmalloc_used_memory(void);
void zmalloc_enable_thread_safeness(void);
void zmalloc_set_oom_handler(void (*oom_handler)(size_t));
-float zmalloc_get_fragmentation_ratio(void);
+float zmalloc_get_fragmentation_ratio(size_t rss);
size_t zmalloc_get_rss(void);
size_t zmalloc_get_private_dirty(void);
void zlibc_free(void *ptr);