Re: json(b)_array_elements use causes very large memory usage when also referencing entire json document

Lucas Fairchild-Madar <lucas.madar@gmail.com>

From: Lucas Fairchild-Madar <lucas.madar@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Date: 2017-10-06T18:45:07Z
Lists: pgsql-bugs
On Fri, Oct 6, 2017 at 11:30 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Lucas Fairchild-Madar <lucas.madar@gmail.com> writes:
> > This might be related to or a duplicate of: BUG #14843: CREATE TABLE
> churns
> > through all memory
>
> Yeah, sounds like it.  Can you check if the just-committed patch
> fixes it?
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=
> 0c25e9652461c08b5caef259a6af27a38707e07a
>
>
I'm experiencing this on 9.6. Can't figure out where this patch applies
there.

In the meantime, I'll try to reproduce on 10 and see what happens.

Commits

  1. Reduce memory usage of targetlist SRFs.

  2. Fix intra-query memory leakage in nodeProjectSet.c.