mirror of https://github.com/milvus-io/milvus.git
fix:[2.5]Add debug memory freeing in sortStats (#41285)
Add debug memory freeing in createJSONKeyIndex function issue: https://github.com/milvus-io/milvus/issues/41218 pr:https://github.com/milvus-io/milvus/pull/41284 --------- Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>pull/41368/head
parent
741838a1dc
commit
b3d3a268b3
|
@ -20,6 +20,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
sio "io"
|
||||
"runtime/debug"
|
||||
"sort"
|
||||
"strconv"
|
||||
"time"
|
||||
|
@ -322,6 +323,10 @@ func (st *statsTask) sortSegment(ctx context.Context) ([]*datapb.FieldBinlog, er
|
|||
zap.Duration("sort elapse", sortTimeCost),
|
||||
zap.Duration("serWrite elapse", serWriteTimeCost),
|
||||
zap.Duration("total elapse", totalElapse))
|
||||
|
||||
writer = nil
|
||||
values = nil
|
||||
debug.FreeOSMemory()
|
||||
return insertLogs, nil
|
||||
}
|
||||
|
||||
|
@ -785,6 +790,7 @@ func (st *statsTask) createJSONKeyIndex(ctx context.Context,
|
|||
log.Info("create json key index failed dataformat invalid")
|
||||
return nil
|
||||
}
|
||||
|
||||
fieldBinlogs := lo.GroupBy(insertBinlogs, func(binlog *datapb.FieldBinlog) int64 {
|
||||
return binlog.GetFieldID()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue