mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 11:51:01 +00:00
Document why we update peak memory in INFO.
This commit is contained in:
parent
0c1bb1313c
commit
12a88d575d
@ -2409,9 +2409,12 @@ sds genRedisInfoString(char *section) {
|
||||
char peak_hmem[64];
|
||||
size_t zmalloc_used = zmalloc_used_memory();
|
||||
|
||||
if (zmalloc_used > server.stat_peak_memory) {
|
||||
/* Peak memory is updated from time to time by serverCron() so it
|
||||
* may happen that the instantaneous value is slightly bigger than
|
||||
* the peak value. This may confuse users, so we update the peak
|
||||
* if found smaller than the current memory usage. */
|
||||
if (zmalloc_used > server.stat_peak_memory)
|
||||
server.stat_peak_memory = zmalloc_used;
|
||||
}
|
||||
|
||||
bytesToHuman(hmem,zmalloc_used);
|
||||
bytesToHuman(peak_hmem,server.stat_peak_memory);
|
||||
|
Loading…
Reference in New Issue
Block a user