From 59509c3a17613a29a4294650ae6e5008f0130d58 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 22 Dec 2023 14:04:05 -0500 Subject: [PATCH] Added extra 5% to memory estimate --- src/hnswbuild.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hnswbuild.c b/src/hnswbuild.c index 426364a..dbc7027 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -369,7 +369,8 @@ HnswElementMemory(HnswElement e, int m) elementSize += VARSIZE_ANY(DatumGetPointer(e->value)); /* Each allocation has a chunk header */ elementSize += (e->level + 7) * GENERATIONCHUNK_RAWSIZE; - return elementSize; + /* Add an extra 5% for alignment and other overhead */ + return elementSize * 1.05; } #endif