1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Add debug code to aid in memory-leak tracking: if SHOW_MEMORY_STATS is

defined then statistics about memory usage of all the global memory
contexts are printed after each commit.
This commit is contained in:
Tom Lane
2000-05-21 02:23:30 +00:00
parent 25a7a7f446
commit aa16179118
5 changed files with 71 additions and 9 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.20 2000/01/26 05:57:30 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.21 2000/05/21 02:23:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -489,7 +489,7 @@ GlobalMemoryDump(GlobalMemory this)
if (PointerIsValid(context))
printf("\tsucessor=%s\n", GlobalMemoryGetName(context));
AllocSetDump(&this->setData); /* XXX is this right interface */
AllocSetDump(&this->setData);
}
/*
@@ -511,9 +511,26 @@ DumpGlobalMemories()
{
GlobalMemoryDump(context);
context = (GlobalMemory) OrderedElemGetSuccessor(
&context->elemData);
context = (GlobalMemory) OrderedElemGetSuccessor(&context->elemData);
}
}
#endif
/*
* GlobalMemoryStats
* Displays stats about memory consumption of all global contexts.
*/
void
GlobalMemoryStats(void)
{
GlobalMemory context;
context = (GlobalMemory) OrderedSetGetHead(&ActiveGlobalMemorySetData);
while (PointerIsValid(context))
{
AllocSetStats(&context->setData, GlobalMemoryGetName(context));
context = (GlobalMemory) OrderedElemGetSuccessor(&context->elemData);
}
}