pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org, Alvaro Herrera <alvherre@2ndquadrant.com>
Subject: Re: BUG #15321: XMLTABLE leaks memory like crazy
Date: Sun, 12 Aug 2018 11:11:32 -0400
Message-ID: <17553.1534086692@sss.pgh.pa.us> (raw)
In-Reply-To: <877ekv7s9j.fsf@news-spur.riddles.org.uk>
References: <153394403528.10284.7530399040974170549@wrigleys.postgresql.org>
	<87va8h7nyl.fsf@news-spur.riddles.org.uk>
	<87r2j57hdo.fsf@news-spur.riddles.org.uk>
	<CAFj8pRAm9cRuTf5STnX=0fGLpxhu7CR6GAj8LGq+iuw+NKXfPg@mail.gmail.com>
	<CAFj8pRBMpOn7X-N2PZKFtMK2UNjTahoArGmtMo1C7Az0x9Rzeg@mail.gmail.com>
	<87k1ow6o7i.fsf@news-spur.riddles.org.uk>
	<CAFj8pRD7bkGhn47wTw-CPhAQgH8OikezB=JrzVRsP_RAWH-scA@mail.gmail.com>
	<87ftzk6jw2.fsf@news-spur.riddles.org.uk>
	<CAFj8pRDWORKuuLEvFN-tMp06nuD5g_+yPAWWVW7umanoriEwwg@mail.gmail.com>
	<87bma77v67.fsf@news-spur.riddles.org.uk>
	<CAFj8pRDr74=wxRD68EGMS6Z90rTn4JOp6g9s_3BE37gtkJAX6A@mail.gmail.com>
	<877ekv7s9j.fsf@news-spur.riddles.org.uk>

Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> Attached patch is the same logic as before but with more comments.

This looks generally reasonable to me, but what's the point of doing
two MemoryContextReset calls in tfuncFetchRows?  Doing one at the
end should be sufficient to guarantee that the context is empty already
at the next call.

Also, I'd be inclined to rename "perValueCxt" to something else,
it's not really correctly named for this usage pattern.

			regards, tom lane




view thread (20+ messages)  latest in thread

Message-ID: <17553.1534086692@sss.pgh.pa.us>
Permalink:  ../17553.1534086692@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17553.1534086692@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, pavel.stehule@gmail.com, alvherre@2ndquadrant.com
  Subject: Re: BUG #15321: XMLTABLE leaks memory like crazy
  In-Reply-To: <17553.1534086692@sss.pgh.pa.us>

* 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