From: Stefan Blanke <stefan.blanke@framestore.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Jan Wieck <jan@wi3ck.info>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: ERROR: invalid memory alloc request size 1073741824
Date: Fri, 13 Mar 2020 14:29:57 +0000
Message-ID: <1b7edcf7-b662-6b6f-87be-8882841d8064@framestore.com> (raw)
In-Reply-To: <6704.1583941079@sss.pgh.pa.us>
References: <733ecd96-48ed-8d49-15e1-413eb535c4c6@framestore.com>
<CAGBW59dUpbSvVHueoYYR3zk04gWPAuutSuLS-bAGPyMbG9Ow0g@mail.gmail.com>
<28d517a9-bf36-1a79-c2e7-6356dcd31064@2ndquadrant.com>
<ab3b5179-e840-4205-1841-6315c9f62583@framestore.com>
<CAGBW59dKrpjPLkEMu_bfyJuF=DM7+d8v+M8YDMkaUEhmu3pMeQ@mail.gmail.com>
<9b1b1008-45fd-8c1a-c45b-6b5be9b24e53@2ndquadrant.com>
<a3254338-a942-21a3-6393-9cc2a71f9810@framestore.com>
<6704.1583941079@sss.pgh.pa.us>
> Could you adjust your process to log the actual temp table size
> each time, ie "select count(*) from temp_table" in between the
> two steps, and then note whether the failures are correlated
> with unusual temp table sizes?
Thanks, I'll add a count there and come back with a number when we next
hit the "invalid memory alloc".
Stefan
On 11/03/2020 15:37, Tom Lane wrote:
> Stefan Blanke <stefan.blanke@framestore.com> writes:
>> We've upgraded to PostgreSQL 11.5 (postgresql.org rhel 6 rpm) and I have
>> had another occurrence of this invalid alloc of 1GB. Apologies for never
>> providing a query plan when discussing this two years ago; we decided to
>> move to a newer PostgreSQL to see if the issue went away but took a
>> while to complete the move.
>
>> The invalid alloc still only occurs occasionally every few months on a
>> query that we run every minute; so unfortunately we still don't have a
>> contained reproducible test case.
>
> Given the lack of stats, I wonder whether the issue could be related
> to the plan sometimes being horribly bad, eg due to the temp table
> being much larger than expected. (A possible mechanism would be
> hash table bloat, perhaps, but that's getting way ahead of the
> evidence.)
>
> Could you adjust your process to log the actual temp table size
> each time, ie "select count(*) from temp_table" in between the
> two steps, and then note whether the failures are correlated
> with unusual temp table sizes?
>
> regards, tom lane
>
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-general@postgresql.org
Cc: stefan.blanke@framestore.com, tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com, jan@wi3ck.info
Subject: Re: ERROR: invalid memory alloc request size 1073741824
In-Reply-To: <1b7edcf7-b662-6b6f-87be-8882841d8064@framestore.com>
References: <733ecd96-48ed-8d49-15e1-413eb535c4c6@framestore.com> <CAGBW59dUpbSvVHueoYYR3zk04gWPAuutSuLS-bAGPyMbG9Ow0g@mail.gmail.com> <28d517a9-bf36-1a79-c2e7-6356dcd31064@2ndquadrant.com> <ab3b5179-e840-4205-1841-6315c9f62583@framestore.com> <CAGBW59dKrpjPLkEMu_bfyJuF=DM7+d8v+M8YDMkaUEhmu3pMeQ@mail.gmail.com> <9b1b1008-45fd-8c1a-c45b-6b5be9b24e53@2ndquadrant.com> <a3254338-a942-21a3-6393-9cc2a71f9810@framestore.com> <6704.1583941079@sss.pgh.pa.us> <1b7edcf7-b662-6b6f-87be-8882841d8064@framestore.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