Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id BB3921337B49 for ; Thu, 16 Dec 2010 18:27:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 76850-10 for ; Thu, 16 Dec 2010 22:27:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4B9DE1337B9A for ; Thu, 16 Dec 2010 18:27:25 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oBGMRM3h015535; Thu, 16 Dec 2010 17:27:22 -0500 (EST) To: Tatsuhito Kasahara cc: pgsql-bugs@postgresql.org Subject: Re: memory leaks? using savepoint In-reply-to: <4D09BB92.6080309@oss.ntt.co.jp> References: <4D09BB92.6080309@oss.ntt.co.jp> Comments: In-reply-to Tatsuhito Kasahara message dated "Thu, 16 Dec 2010 16:11:14 +0900" Date: Thu, 16 Dec 2010 17:27:22 -0500 Message-ID: <15534.1292538442@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/122 X-Sequence-Number: 28928 Tatsuhito Kasahara writes: > When I tested simple query as following, backend process used much memory > and not freed until the backend was finished. > # This is reproduced on PostgreSQL8.3 (PostgreSQL8.3.6 - PostgreSQL8.3.12) Hmm ... this test case doesn't appear to produce any significant memory leakage in 8.4 and up. What is happening in 8.3 is that the CurTransactionContext of each subtransaction becomes nonempty, so it eats 8K or so even though the snapshot gets released shortly later. There are plenty of other ways to cause that to happen, though, so I'm not particularly excited about fixing this one ... especially not in a stable branch that's not getting a lot of developer testing anymore. I'm inclined to leave this alone --- I think the risks of patching only an old branch will outweigh the benefits. regards, tom lane