未验证 提交 e196caf6 编写于 作者: X xige-16 提交者: GitHub

Force reclamation of memory after loading (#17244)

Signed-off-by: Nxige-16 <xi.ge@zilliz.com>
上级 6110e3a0
......@@ -22,6 +22,7 @@ import (
"fmt"
"path"
"runtime"
"runtime/debug"
"strconv"
"sync"
......@@ -141,6 +142,7 @@ func (loader *segmentLoader) loadSegment(req *querypb.LoadSegmentsRequest, segme
for _, s := range newSegments {
deleteSegment(s)
}
debug.FreeOSMemory()
}
for _, info := range req.Infos {
......@@ -235,6 +237,10 @@ func (loader *segmentLoader) loadSegmentInternal(segment *Segment,
return err
}
// TODO(xige-16): Optimize the data loading process and reduce data copying
// for now, there will be multiple copies in the process of data loading into segCore
defer debug.FreeOSMemory()
var fieldBinlogs []*datapb.FieldBinlog
if segment.getType() == segmentTypeSealed {
fieldID2IndexInfo := make(map[int64]*querypb.FieldIndexInfo)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册