mirror of https://github.com/milvus-io/milvus.git
Free OS memory in QueryNode and IndexNode (#14305)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>pull/14640/head
parent
a2f2324131
commit
8a3a1b556a
|
@ -10,6 +10,7 @@
|
|||
// or implied. See the License for the specific language governing permissions and limitations under the License
|
||||
|
||||
#include <string>
|
||||
#include <malloc.h>
|
||||
#include "index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.h"
|
||||
#include "indexbuilder/IndexWrapper.h"
|
||||
#include "indexbuilder/index_c.h"
|
||||
|
@ -46,6 +47,7 @@ void
|
|||
DeleteIndex(CIndex index) {
|
||||
auto cIndex = (milvus::indexbuilder::IndexWrapper*)index;
|
||||
delete cIndex;
|
||||
malloc_trim(0);
|
||||
}
|
||||
|
||||
CStatus
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
// or implied. See the License for the specific language governing permissions and limitations under the License
|
||||
|
||||
#include <iostream>
|
||||
#include <malloc.h>
|
||||
#include "segcore/collection_c.h"
|
||||
#include "segcore/Collection.h"
|
||||
|
||||
|
@ -24,6 +25,7 @@ void
|
|||
DeleteCollection(CCollection collection) {
|
||||
auto col = (milvus::segcore::Collection*)collection;
|
||||
delete col;
|
||||
malloc_trim(0);
|
||||
}
|
||||
|
||||
const char*
|
||||
|
|
|
@ -49,7 +49,7 @@ import (
|
|||
// ---------- unittest util functions ----------
|
||||
// common definitions
|
||||
const ctxTimeInMillisecond = 500
|
||||
const debug = false
|
||||
const debugUT = false
|
||||
|
||||
const (
|
||||
dimKey = "dim"
|
||||
|
|
|
@ -177,7 +177,7 @@ func newQueryNodeMock() *QueryNode {
|
|||
|
||||
var ctx context.Context
|
||||
|
||||
if debug {
|
||||
if debugUT {
|
||||
ctx = context.Background()
|
||||
} else {
|
||||
var cancel context.CancelFunc
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -793,6 +794,8 @@ func (r *releaseCollectionTask) Execute(ctx context.Context) error {
|
|||
}
|
||||
r.node.historical.removeGlobalSegmentIDsByCollectionID(r.req.CollectionID)
|
||||
|
||||
debug.FreeOSMemory()
|
||||
|
||||
log.Debug("ReleaseCollection done", zap.Int64("collectionID", r.req.CollectionID))
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue