pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@heroku.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: blake@rcmail.com, pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: Andres Freund <andres@anazarel.de>
Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Date: Wed, 6 Jul 2016 14:40:02 -0700
Message-ID: <CAM3SWZSqBWmJEwu6-aFkN7XkPdybw_nrSfcjNtnJvq8m8-Rcig@mail.gmail.com> (raw)
In-Reply-To: <20160706212600.GA649263@alvherre.pgsql>
References: <878txea5b4.fsf@news-spur.riddles.org.uk>
	<20160706212600.GA649263@alvherre.pgsql>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Wed, Jul 6, 2016 at 2:26 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>> So I think this is primarily an artifact of doing so much retail
>> palloc/pfree in a single memory context.
>
> As I recall, this is the main reason Andres stuck the slab cache in
> reorderbuffer.  Maybe it'd be worthwhile to implement a different
> MemoryContext tailored to this use case, and remove the slab cache
> stuff.

I withdraw my remarks on that commit -- I don't think that's what it is now.

I had luck adding a new child memory context for tuplesort.c in commit
0011c0091e886b874e485a46ff2c94222ffbf550. This allowed tuplesort.c to
blow away the free list via a new call to MemoryContextReset(). This
didn't even remove *any* pfree() operations in the affected codepath,
but was still quite effective.

I'm not sure that that's comparable, but it may be an interesting case
that others are not aware of.

-- 
Peter Geoghegan


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (19+ messages)  latest in thread

Message-ID: <CAM3SWZSqBWmJEwu6-aFkN7XkPdybw_nrSfcjNtnJvq8m8-Rcig@mail.gmail.com>
Permalink:  ../CAM3SWZSqBWmJEwu6-aFkN7XkPdybw_nrSfcjNtnJvq8m8-Rcig@mail.gmail.com/
Also on:    postgresql.org/message-id/CAM3SWZSqBWmJEwu6-aFkN7XkPdybw_nrSfcjNtnJvq8m8-Rcig@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: pg@heroku.com, alvherre@2ndquadrant.com, andrew@tao11.riddles.org.uk, andres@anazarel.de
  Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function
  In-Reply-To: <CAM3SWZSqBWmJEwu6-aFkN7XkPdybw_nrSfcjNtnJvq8m8-Rcig@mail.gmail.com>
  References: <878txea5b4.fsf@news-spur.riddles.org.uk> <20160706212600.GA649263@alvherre.pgsql> <CAM3SWZSqBWmJEwu6-aFkN7XkPdybw_nrSfcjNtnJvq8m8-Rcig@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox