From aa1617911836bd8f500320a365d59920fca2613b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 21 May 2000 02:23:30 +0000 Subject: 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. --- src/backend/tcop/postgres.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index b6c69356130..683f057f212 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.154 2000/04/30 21:29:23 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.155 2000/05/21 02:23:30 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1452,7 +1452,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[]) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.154 $ $Date: 2000/04/30 21:29:23 $\n"); + puts("$Revision: 1.155 $ $Date: 2000/05/21 02:23:30 $\n"); } /* @@ -1631,6 +1631,11 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[]) TPRINTF(TRACE_VERBOSE, "CommitTransactionCommand"); PS_SET_STATUS("commit"); CommitTransactionCommand(); +#ifdef SHOW_MEMORY_STATS + /* print global-context stats at each commit for leak tracking */ + if (ShowStats) + GlobalMemoryStats(); +#endif } else { -- cgit v1.2.3