Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
12a88d57
Commit
12a88d57
authored
Mar 03, 2014
by
antirez
Browse files
Document why we update peak memory in INFO.
parent
0c1bb131
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
12a88d57
...
@@ -2409,9 +2409,12 @@ sds genRedisInfoString(char *section) {
...
@@ -2409,9 +2409,12 @@ sds genRedisInfoString(char *section) {
char
peak_hmem
[
64
];
char
peak_hmem
[
64
];
size_t
zmalloc_used
=
zmalloc_used_memory
();
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
;
server
.
stat_peak_memory
=
zmalloc_used
;
}
bytesToHuman
(
hmem
,
zmalloc_used
);
bytesToHuman
(
hmem
,
zmalloc_used
);
bytesToHuman
(
peak_hmem
,
server
.
stat_peak_memory
);
bytesToHuman
(
peak_hmem
,
server
.
stat_peak_memory
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment