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
6888c1a1
Commit
6888c1a1
authored
Apr 09, 2018
by
antirez
Browse files
freeMemoryIfNeeded() lacked a top comment.
parent
9a0dbbb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/evict.c
View file @
6888c1a1
...
...
@@ -369,6 +369,15 @@ size_t freeMemoryGetNotCountedMemory(void) {
return
overhead
;
}
/* This function is periodically called to see if there is memory to free
* according to the current "maxmemory" settings. In case we are over the
* memory limit, the function will try to free some memory to return back
* under the limit.
*
* The function returns C_OK if we are under the memory limit or if we
* were over the limit, but the attempt to free memory was successful.
* Otehrwise if we are over the memory limit, but not enough memory
* was freed to return back under the limit, the function returns C_ERR. */
int
freeMemoryIfNeeded
(
void
)
{
size_t
mem_reported
,
mem_used
,
mem_tofree
,
mem_freed
;
mstime_t
latency
,
eviction_latency
;
...
...
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