Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
b9f35001
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b9f35001
编写于
10月 31, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-225] fix memory leaks.
上级
80b2acff
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
7 deletion
+10
-7
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+6
-4
src/query/src/qUtil.c
src/query/src/qUtil.c
+2
-2
未找到文件。
src/query/inc/qExecutor.h
浏览文件 @
b9f35001
...
...
@@ -122,7 +122,8 @@ typedef struct SQueryCostInfo {
uint32_t
discardBlocks
;
uint64_t
elapsedTime
;
uint64_t
firstStageMergeTime
;
uint64_t
internalSupSize
;
uint64_t
winInfoSize
;
uint64_t
tableInfoSize
;
uint64_t
numOfTimeWindows
;
}
SQueryCostInfo
;
...
...
src/query/src/qExecutor.c
浏览文件 @
b9f35001
...
...
@@ -469,7 +469,7 @@ static SWindowResult *doSetTimeWindowFromKey(SQueryRuntimeEnv *pRuntimeEnv, SWin
}
char
*
t
=
realloc
(
pWindowResInfo
->
pResult
,
(
size_t
)(
newCap
*
sizeof
(
SWindowResult
)));
pRuntimeEnv
->
summary
.
internalSup
Size
+=
(
newCap
-
pWindowResInfo
->
capacity
)
*
sizeof
(
SWindowResult
);
pRuntimeEnv
->
summary
.
winInfo
Size
+=
(
newCap
-
pWindowResInfo
->
capacity
)
*
sizeof
(
SWindowResult
);
pRuntimeEnv
->
summary
.
numOfTimeWindows
+=
(
newCap
-
pWindowResInfo
->
capacity
);
if
(
t
==
NULL
)
{
...
...
@@ -481,7 +481,7 @@ static SWindowResult *doSetTimeWindowFromKey(SQueryRuntimeEnv *pRuntimeEnv, SWin
int32_t
inc
=
(
int32_t
)
newCap
-
pWindowResInfo
->
capacity
;
memset
(
&
pWindowResInfo
->
pResult
[
pWindowResInfo
->
capacity
],
0
,
sizeof
(
SWindowResult
)
*
inc
);
pRuntimeEnv
->
summary
.
internalSup
Size
+=
(
pQuery
->
numOfOutput
*
sizeof
(
SResultInfo
)
+
pRuntimeEnv
->
interBufSize
)
*
inc
;
pRuntimeEnv
->
summary
.
winInfo
Size
+=
(
pQuery
->
numOfOutput
*
sizeof
(
SResultInfo
)
+
pRuntimeEnv
->
interBufSize
)
*
inc
;
for
(
int32_t
i
=
pWindowResInfo
->
capacity
;
i
<
newCap
;
++
i
)
{
int32_t
ret
=
createQueryResultInfo
(
pQuery
,
&
pWindowResInfo
->
pResult
[
i
],
pRuntimeEnv
->
stableQuery
,
pRuntimeEnv
->
interBufSize
);
...
...
@@ -4254,8 +4254,8 @@ static void queryCostStatis(SQInfo *pQInfo) {
pQInfo
,
pSummary
->
elapsedTime
,
pSummary
->
firstStageMergeTime
,
pSummary
->
totalBlocks
,
pSummary
->
loadBlockStatis
,
pSummary
->
loadBlocks
,
pSummary
->
totalRows
,
pSummary
->
totalCheckedRows
);
qDebug
(
"QInfo:%p :cost summary:
internal size:%"
PRId64
"B, numOfWin:%"
PRId64
,
pQInfo
,
pSummary
->
internalSup
Size
,
pSummary
->
numOfTimeWindows
);
qDebug
(
"QInfo:%p :cost summary:
windowInfo size:%"
PRId64
" k, numOfWin:%"
PRId64
", tableInfoSize:%"
PRId64
" k"
,
pQInfo
,
pSummary
->
winInfo
Size
,
pSummary
->
numOfTimeWindows
/
1000
,
pSummary
->
tableInfoSize
/
1000
);
}
static
void
updateOffsetVal
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SDataBlockInfo
*
pBlockInfo
)
{
...
...
@@ -6312,6 +6312,8 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SSqlGroupbyExpr *pGrou
int
tableIndex
=
0
;
pQInfo
->
runtimeEnv
.
interBufSize
=
getOutputInterResultBufSize
(
pQuery
);
pQInfo
->
runtimeEnv
.
summary
.
tableInfoSize
+=
(
pTableGroupInfo
->
numOfTables
*
sizeof
(
STableQueryInfo
));
pQInfo
->
pBuf
=
calloc
(
pTableGroupInfo
->
numOfTables
,
sizeof
(
STableQueryInfo
));
if
(
pQInfo
->
pBuf
==
NULL
)
{
goto
_cleanup
;
...
...
src/query/src/qUtil.c
浏览文件 @
b9f35001
...
...
@@ -56,8 +56,8 @@ int32_t initWindowResInfo(SWindowResInfo *pWindowResInfo, SQueryRuntimeEnv *pRun
pWindowResInfo
->
interval
=
pRuntimeEnv
->
pQuery
->
interval
.
interval
;
pSummary
->
internalSup
Size
+=
sizeof
(
SWindowResult
)
*
threshold
;
pSummary
->
internalSup
Size
+=
(
pRuntimeEnv
->
pQuery
->
numOfOutput
*
sizeof
(
SResultInfo
)
+
pRuntimeEnv
->
interBufSize
)
*
pWindowResInfo
->
capacity
;
pSummary
->
winInfo
Size
+=
sizeof
(
SWindowResult
)
*
threshold
;
pSummary
->
winInfo
Size
+=
(
pRuntimeEnv
->
pQuery
->
numOfOutput
*
sizeof
(
SResultInfo
)
+
pRuntimeEnv
->
interBufSize
)
*
pWindowResInfo
->
capacity
;
pSummary
->
numOfTimeWindows
=
threshold
;
for
(
int32_t
i
=
0
;
i
<
pWindowResInfo
->
capacity
;
++
i
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录