From 50d1aed3d8cf81155bfc2558a90d8913adb80995 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 22 Dec 2023 13:09:11 -0500 Subject: [PATCH] Improved memory usage logging [skip ci] --- src/hnswbuild.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hnswbuild.c b/src/hnswbuild.c index 86ec888..2317517 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -267,9 +267,11 @@ FlushPages(HnswBuildState * buildstate) { #ifdef HNSW_MEMORY #if PG_VERSION_NUM >= 130000 - elog(INFO, "memory: %zu MB", MemoryContextMemAllocated(buildstate->graphCtx, false) / (1024 * 1024)); + elog(INFO, "graph memory: %zu MB, total memory: %zu MB", + MemoryContextMemAllocated(buildstate->graphCtx, false) / (1024 * 1024), + MemoryContextMemAllocated(CurrentMemoryContext, true) / (1024 * 1024)); #else - MemoryContextStats(buildstate->graphCtx); + MemoryContextStats(CurrentMemoryContext); #endif #endif