Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Force INFO used_memory_peak to match peak memory #1572

Merged
merged 1 commit into from Mar 3, 2014

Conversation

Projects
None yet
2 participants
Contributor

mattsta commented Feb 28, 2014

This is a fix for antirez/redis#1570

used_memory_peak only updates in serverCron every server.hz,
but Redis can use more memory and a user can request memory
INFO before used_memory_peak gets updated in the next
cron run.

This patch updates used_memory_peak to the current
memory usage if the current memory usage is higher
than the recorded used_memory_peak value.

(And it only calls zmalloc_used_memory() once instead of
twice as it was doing before.)

@mattsta mattsta Force INFO used_memory_peak to match peak memory
used_memory_peak only updates in serverCron every server.hz,
but Redis can use more memory and a user can request memory
INFO before used_memory_peak gets updated in the next
cron run.

This patch updates used_memory_peak to the current
memory usage if the current memory usage is higher
than the recorded used_memory_peak value.

(And it only calls zmalloc_used_memory() once instead of
twice as it was doing before.)
f1c9a20

@antirez antirez added a commit that referenced this pull request Mar 3, 2014

@antirez antirez Merge pull request #1572 from mattsta/consistent-max-memory-info
Force INFO used_memory_peak to match peak memory
68d6d15

@antirez antirez merged commit 68d6d15 into antirez:unstable Mar 3, 2014

Owner

antirez commented Mar 3, 2014

Thanks, merged, just adding a comment to let the casual reader understanding why there is an update of the value there.

@mattsta mattsta deleted the mattsta:consistent-max-memory-info branch Mar 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment