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
68d6d159
Commit
68d6d159
authored
Mar 03, 2014
by
Salvatore Sanfilippo
Browse files
Merge pull request #1572 from mattsta/consistent-max-memory-info
Force INFO used_memory_peak to match peak memory
parents
8b8c1cd4
f1c9a203
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
68d6d159
...
@@ -2407,8 +2407,13 @@ sds genRedisInfoString(char *section) {
...
@@ -2407,8 +2407,13 @@ sds genRedisInfoString(char *section) {
if
(
allsections
||
defsections
||
!
strcasecmp
(
section
,
"memory"
))
{
if
(
allsections
||
defsections
||
!
strcasecmp
(
section
,
"memory"
))
{
char
hmem
[
64
];
char
hmem
[
64
];
char
peak_hmem
[
64
];
char
peak_hmem
[
64
];
size_t
zmalloc_used
=
zmalloc_used_memory
();
bytesToHuman
(
hmem
,
zmalloc_used_memory
());
if
(
zmalloc_used
>
server
.
stat_peak_memory
)
{
server
.
stat_peak_memory
=
zmalloc_used
;
}
bytesToHuman
(
hmem
,
zmalloc_used
);
bytesToHuman
(
peak_hmem
,
server
.
stat_peak_memory
);
bytesToHuman
(
peak_hmem
,
server
.
stat_peak_memory
);
if
(
sections
++
)
info
=
sdscat
(
info
,
"
\r\n
"
);
if
(
sections
++
)
info
=
sdscat
(
info
,
"
\r\n
"
);
info
=
sdscatprintf
(
info
,
info
=
sdscatprintf
(
info
,
...
@@ -2421,7 +2426,7 @@ sds genRedisInfoString(char *section) {
...
@@ -2421,7 +2426,7 @@ sds genRedisInfoString(char *section) {
"used_memory_lua:%lld
\r\n
"
"used_memory_lua:%lld
\r\n
"
"mem_fragmentation_ratio:%.2f
\r\n
"
"mem_fragmentation_ratio:%.2f
\r\n
"
"mem_allocator:%s
\r\n
"
,
"mem_allocator:%s
\r\n
"
,
zmalloc_used
_memory
()
,
zmalloc_used
,
hmem
,
hmem
,
zmalloc_get_rss
(),
zmalloc_get_rss
(),
server
.
stat_peak_memory
,
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