Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
b129c6df
R
redis
项目概览
hanoi2005
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b129c6df
编写于
2月 08, 2012
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debugging messages removed from freeMemoryIfNeeded()
上级
609baba8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
1 addition
and
15 deletion
+1
-15
src/redis.c
src/redis.c
+1
-15
未找到文件。
src/redis.c
浏览文件 @
b129c6df
...
...
@@ -1801,18 +1801,10 @@ void monitorCommand(redisClient *c) {
int
freeMemoryIfNeeded
(
void
)
{
size_t
mem_used
,
mem_tofree
,
mem_freed
;
int
slaves
=
listLength
(
server
.
slaves
);
static
time_t
xt
;
int
debug
=
0
;
if
(
xt
!=
time
(
NULL
))
{
debug
=
1
;
xt
=
time
(
NULL
);
}
/* Remove the size of slaves output buffers and AOF buffer from the
* count of used memory. */
mem_used
=
zmalloc_used_memory
();
if
(
debug
)
printf
(
"used_full: %zu
\n
"
,
mem_used
);
if
(
slaves
)
{
listIter
li
;
listNode
*
ln
;
...
...
@@ -1827,7 +1819,6 @@ int freeMemoryIfNeeded(void) {
mem_used
-=
obuf_bytes
;
}
}
if
(
debug
)
printf
(
"used_nosl: %zu
\n
"
,
mem_used
);
if
(
server
.
aof_state
!=
REDIS_AOF_OFF
)
{
mem_used
-=
sdslen
(
server
.
aof_buf
);
mem_used
-=
sdslen
(
server
.
aof_rewrite_buf
);
...
...
@@ -1842,7 +1833,6 @@ int freeMemoryIfNeeded(void) {
/* Compute how much memory we need to free. */
mem_tofree
=
mem_used
-
server
.
maxmemory
;
mem_freed
=
0
;
if
(
debug
)
printf
(
"tofree: %zu
\n
"
,
mem_tofree
);
while
(
mem_freed
<
mem_tofree
)
{
int
j
,
k
,
keys_freed
=
0
;
...
...
@@ -1944,12 +1934,8 @@ int freeMemoryIfNeeded(void) {
if
(
slaves
)
flushSlavesOutputBuffers
();
}
}
if
(
!
keys_freed
)
{
if
(
debug
)
printf
(
"-freed: %zu
\n\n
"
,
mem_freed
);
return
REDIS_ERR
;
/* nothing to free... */
}
if
(
!
keys_freed
)
return
REDIS_ERR
;
/* nothing to free... */
}
if
(
debug
)
printf
(
"+freed: %zu
\n\n
"
,
mem_freed
);
return
REDIS_OK
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录