Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UjrHW-00012e-1F for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Jun 2013 13:28:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UjrHV-0008UV-Ft for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Jun 2013 13:28:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UjrHU-0008U4-OD for pgsql-bugs@postgresql.org; Tue, 04 Jun 2013 13:28:08 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UjrHM-0001hr-Sq for pgsql-bugs@postgresql.org; Tue, 04 Jun 2013 13:28:08 +0000 Received: from intern.anarazel.de (p5DDC63F6.dip0.t-ipconnect.de [93.220.99.246]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id B9F614F0001; Tue, 4 Jun 2013 15:27:59 +0200 (CEST) Date: Tue, 4 Jun 2013 15:27:58 +0200 From: Andres Freund To: Heikki Linnakangas Cc: Stephen Frost , Naoya Anzai , pgsql-bugs@postgresql.org, Akio Iwaasa Subject: Re: Memory-leak in BackgroundWriter(and Checkpointer) Message-ID: <20130604132758.GC2854@alap2.anarazel.de> References: <20130604122736.GH5871@tamriel.snowman.net> <51ADEA34.4080704@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51ADEA34.4080704@vmware.com> X-Pg-Spam-Score: -2.6 (--) 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 On 2013-06-04 16:23:00 +0300, Heikki Linnakangas wrote: > On 04.06.2013 15:27, Stephen Frost wrote: > >* Naoya Anzai (anzai-naoya@mxu.nes.nec.co.jp) wrote: > >>I've found a memory-leak bug in PostgreSQL 9.1.9's background > >>writer process. > > > >This looks legit, but probably not the right approach to fixing it. > >Looks like it'd be better to work out a way to use a static variable to > >reuse the same memory, ala what GetRunningTransactionData() does, and > >avoid having to do allocation while holding all the locks (or at least, > >not very often). > > I can't get too excited about the overhead of a single palloc here. It's a > fairly heavy operation anyway, and only runs once per checkpoint. And we > haven't heard any actual complaints of latency hiccups with > wal_level=hot_standby. I think we will have to resort to running it more frequently in the not too far away future, its way to easy to get into a situation where all of the checkpoints/xl_running_xact's are suboverflowed delaying consistency considerably. Seems more consistent with the rest of the code too. But anyway, I am fine with fixing it either way. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs