Re: pgsql: Generational memory allocator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Generational memory allocator
Date: 2017-11-25 21:46:02
Message-ID: 2875.1511646362@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

I wrote:
> Instead I propose that we should make sure that the palloc request size
> for XLogReaderState->main_data is always maxalign'd. The existing
> behavior in DecodeXLogRecord of palloc'ing it only just barely big
> enough for the current record seems pretty brain-dead performance-wise
> even without this consideration. Generally, if we need to enlarge
> that buffer, we should enlarge it significantly, IMO.

I've confirmed that the attached is sufficient to stop the valgrind crash
on my machine. But as I said, I think we should be more aggressive at
resizing the buffer, to reduce resize cycles. I'm inclined to start out
with a buffer size of 128 or 256 or so bytes and double it when needed.
Anybody have a feeling for a typical size for the "main data" part
of a WAL record?

regards, tom lane

Attachment Content-Type Size
pad-xlog-buffer-size.patch text/x-diff 792 bytes

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-11-25 23:15:46 pgsql: Update MSVC build process for new timezone data.
Previous Message Tom Lane 2017-11-25 21:19:20 Re: pgsql: Generational memory allocator