X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 91DEB30EEAB for ; Tue, 17 Jun 2003 19:38:14 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 75611-04 for ; Tue, 17 Jun 2003 16:38:04 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id E1A7D30E962 for ; Tue, 17 Jun 2003 16:38:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h5HJc2U6014876; Tue, 17 Jun 2003 15:38:02 -0400 (EDT) To: Dawn Hollingsworth Cc: pgsql-performance@postgresql.org, Ben Scherrey Subject: Re: Postgres Connections Requiring Large Amounts of Memory In-reply-to: <1055832411.5467.100.camel@kaos> References: <1055752337.2182.49.camel@kaos> <6634.1055796302@sss.pgh.pa.us> <1055753856.5467.57.camel@kaos> <6892.1055799269@sss.pgh.pa.us> <1055832411.5467.100.camel@kaos> Comments: In-reply-to Dawn Hollingsworth message dated "17 Jun 2003 06:46:48 -0000" Date: Tue, 17 Jun 2003 15:38:02 -0400 Message-ID: <14875.1055878682@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200306/114 X-Sequence-Number: 2198 Dawn Hollingsworth writes: > I attached gdb to a connection using just over 400MB( according to top) > and ran "MemoryContextStats(TopMemoryContext)" Hmm. This only seems to account for about 5 meg of space, which means either that lots of space is being used and released, or that the leak is coming from direct malloc calls rather than palloc. I doubt the latter though; we don't use too many direct malloc calls. On the former theory, could it be something like updating a large number of tuples in one transaction in a table with foreign keys? The pending-triggers list could have swelled up and then gone away again. The large number of SPI Plan contexts seems a tad fishy, and even more so the fact that some of them are rather large. They still only account for a couple of meg, so they aren't directly the problem, but perhaps they are related to the problem. I presume these came from either foreign-key triggers or something you've written in PL functions. Can you tell us more about what you use in that line? regards, tom lane