Re: Memory-leak in BackgroundWriter(and Checkpointer)

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Naoya Anzai <anzai-naoya(at)mxu(dot)nes(dot)nec(dot)co(dot)jp>, pgsql-bugs(at)postgresql(dot)org, Akio Iwaasa <iwaasa(at)mxs(dot)nes(dot)nec(dot)co(dot)jp>
Subject: Re: Memory-leak in BackgroundWriter(and Checkpointer)
Date: 2013-06-04 13:27:58
Message-ID: 20130604132758.GC2854@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2013-06-04 16:23:00 +0300, Heikki Linnakangas wrote:
> On 04.06.2013 15:27, Stephen Frost wrote:
> >* Naoya Anzai (anzai-naoya(at)mxu(dot)nes(dot)nec(dot)co(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephen Frost 2013-06-04 13:49:27 Re: Memory-leak in BackgroundWriter(and Checkpointer)
Previous Message Heikki Linnakangas 2013-06-04 13:23:00 Re: Memory-leak in BackgroundWriter(and Checkpointer)