mirror of https://github.com/milvus-io/milvus.git
Fix memory leak, temp solution
Signed-off-by: FluorineDog <guilin.gou@zilliz.com>pull/4973/head^2
parent
6deba1faa5
commit
43b39cc9c9
|
@ -56,6 +56,17 @@ AssembleNegBitset(const BitsetSimple& bitset_simple) {
|
|||
return result;
|
||||
}
|
||||
|
||||
// TODO: temporary fix
|
||||
// remove this when internal destructor bug is fix
|
||||
static void
|
||||
ReleaseQueryResult(const knowhere::DatasetPtr& result) {
|
||||
float* res_dist = result->Get<float*>(knowhere::meta::DISTANCE);
|
||||
free(res_dist);
|
||||
|
||||
int64_t* res_ids = result->Get<int64_t*>(knowhere::meta::IDS);
|
||||
free(res_ids);
|
||||
}
|
||||
|
||||
void
|
||||
SearchOnSealed(const Schema& schema,
|
||||
const segcore::SealedIndexingRecord& record,
|
||||
|
@ -95,5 +106,9 @@ SearchOnSealed(const Schema& schema,
|
|||
|
||||
std::copy_n(ids, total_num, result.internal_seg_offsets_.data());
|
||||
std::copy_n(distances, total_num, result.result_distances_.data());
|
||||
|
||||
// TODO: temporary fix
|
||||
// remove this when internal destructor bug is fix
|
||||
ReleaseQueryResult(final);
|
||||
}
|
||||
} // namespace milvus::query
|
||||
|
|
Loading…
Reference in New Issue