Skip to content

Commit b38c043

Browse files
committed
Reconsider placement of MemoryContextCheck() call --- do after commit,
not before, to avoid duplication of effort.
1 parent 4cf6e9e commit b38c043

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/backend/tcop/postgres.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.362 2003/09/02 19:04:12 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.363 2003/09/14 00:03:32 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1753,17 +1753,18 @@ finish_xact_command(void)
17531753
/* Cancel any active statement timeout before committing */
17541754
disable_sig_alarm(true);
17551755

1756-
#ifdef MEMORY_CONTEXT_CHECKING
1757-
/* Check memory before committing (since commit discards much) */
1758-
MemoryContextCheck(TopMemoryContext);
1759-
#endif
1760-
17611756
/* Now commit the command */
17621757
ereport(DEBUG3,
17631758
(errmsg_internal("CommitTransactionCommand")));
17641759

17651760
CommitTransactionCommand();
17661761

1762+
#ifdef MEMORY_CONTEXT_CHECKING
1763+
/* Check all memory contexts that weren't freed during commit */
1764+
/* (those that were, were checked before being deleted) */
1765+
MemoryContextCheck(TopMemoryContext);
1766+
#endif
1767+
17671768
#ifdef SHOW_MEMORY_STATS
17681769
/* Print mem stats after each commit for leak tracking */
17691770
if (ShowStats)
@@ -2657,7 +2658,7 @@ PostgresMain(int argc, char *argv[], const char *username)
26572658
if (!IsUnderPostmaster)
26582659
{
26592660
puts("\nPOSTGRES backend interactive interface ");
2660-
puts("$Revision: 1.362 $ $Date: 2003/09/02 19:04:12 $\n");
2661+
puts("$Revision: 1.363 $ $Date: 2003/09/14 00:03:32 $\n");
26612662
}
26622663

26632664
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy