Re: BUG #15700: PG 10 vs. 11: Large increase in memory usage when selecting BYTEA data (maybe memory leak)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Jeff Janes <jeff.janes@gmail.com>, Matthias Otterbach <mo@otterbach.eu>, pgsql-bugs@lists.postgresql.org
Date: 2019-03-18T21:37:41Z
Lists: pgsql-bugs

Attachments

I wrote:
> Jeff Janes <jeff.janes@gmail.com> writes:
>> The culprit is f2dec34e19d3969ddd6.

> Hmm.  I bet problem is that the buf isn't being freed in
> printtup_shutdown.

Yup; the attached fixes it.  Will push after a bit more testing.

			regards, tom lane

Commits

  1. Fix memory leak in printtup.c.

  2. Use one stringbuffer for all rows printed in printtup.c.