From c3ce51ce98e197c970fdf15665e6c2d409a604bd Mon Sep 17 00:00:00 2001 From: cqy123456 <39671710+cqy123456@users.noreply.github.com> Date: Tue, 1 Nov 2022 20:39:30 +0800 Subject: [PATCH] Release free mem in diskann aligned_free function (#520) Signed-off-by: cqy123456 Signed-off-by: cqy123456 --- thirdparty/DiskANN/include/utils.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/thirdparty/DiskANN/include/utils.h b/thirdparty/DiskANN/include/utils.h index 01fe3d120..2f148210d 100644 --- a/thirdparty/DiskANN/include/utils.h +++ b/thirdparty/DiskANN/include/utils.h @@ -204,6 +204,9 @@ namespace diskann { #else ::_aligned_free(ptr); #endif + if (malloc_trim(0) == 0) { + LOG(DEBUG) << "Failed to release free memory from the heap."; + } } inline void GenRandom(std::mt19937& rng, unsigned* addr, unsigned size,