Improved memory usage logging [skip ci]

This commit is contained in:
Andrew Kane
2023-12-22 13:09:11 -05:00
parent 66e14d2434
commit 50d1aed3d8

View File

@@ -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