mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Release memory to OS after index is built (#15196)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
parent
2528b6850d
commit
2819f6cc6f
@ -22,6 +22,7 @@ import (
|
||||
"fmt"
|
||||
"path"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
|
||||
"go.uber.org/zap"
|
||||
@ -490,6 +491,10 @@ func (it *IndexBuildTask) executeSave(ctx context.Context, blobs []*storage.Blob
|
||||
return nil
|
||||
}
|
||||
|
||||
func (it *IndexBuildTask) releaseMemory() {
|
||||
debug.FreeOSMemory()
|
||||
}
|
||||
|
||||
// Execute actually performs the task of building an index.
|
||||
func (it *IndexBuildTask) Execute(ctx context.Context) error {
|
||||
log.Debug("IndexNode IndexBuildTask Execute ...", zap.Int64("buildId", it.req.IndexBuildID))
|
||||
@ -532,5 +537,8 @@ func (it *IndexBuildTask) Execute(ctx context.Context) error {
|
||||
it.tr.Elapse("index building all done")
|
||||
log.Info("IndexNode CreateIndex successfully ", zap.Int64("collect", it.collectionID),
|
||||
zap.Int64("partition", it.partitionID), zap.Int64("segment", it.segmentID))
|
||||
|
||||
it.releaseMemory()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user