Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UjvQ6-0002WU-P2 for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Jun 2013 17:53:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UjvQ5-0004Cc-4o for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Jun 2013 17:53:17 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UjvQ4-0004CX-Fn for pgsql-bugs@postgresql.org; Tue, 04 Jun 2013 17:53:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UjvPz-0000cZ-TS for pgsql-bugs@postgresql.org; Tue, 04 Jun 2013 17:53:15 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r54Hr3kF028229; Tue, 4 Jun 2013 13:53:03 -0400 (EDT) From: Tom Lane To: Stephen Frost cc: Andres Freund , Heikki Linnakangas , Naoya Anzai , pgsql-bugs@postgresql.org, Akio Iwaasa Subject: Re: Memory-leak in BackgroundWriter(and Checkpointer) In-reply-to: <20130604134927.GI5871@tamriel.snowman.net> References: <20130604122736.GH5871@tamriel.snowman.net> <51ADEA34.4080704@vmware.com> <20130604132758.GC2854@alap2.anarazel.de> <20130604134927.GI5871@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Tue, 04 Jun 2013 09:49:27 -0400" Date: Tue, 04 Jun 2013 13:53:03 -0400 Message-ID: <28228.1370368383@sss.pgh.pa.us> X-Pg-Spam-Score: 0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Stephen Frost writes: > * Andres Freund (andres@2ndquadrant.com) wrote: >> Seems more consistent with the rest of the code too. But anyway, I am >> fine with fixing it either way. > And this is really the other point- having LogStandbySnapshot() need to > clean up after GetRunningTransactionLocks() but not > GetRunningTransactionData() would strike me as very odd. Meh. I'm not impressed with permanently allocating an array large enough to hold all the locks GetRunningTransactionLocks might return --- that's potentially much larger than the other array, and in fact I don't think we have a hard limit on its size at all. Besides which, it's not like there is *no* cleanup for GetRunningTransactionData --- it has a lock that has to be released ... I think the proposed fix is fine code-wise; the real problem here is crummy commenting. GetRunningTransactionLocks isn't documented as returning a palloc'd array, and why the heck do we have a long comment about its implementation in LogStandbySnapshot? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs