From: Tom Lane <tgl@sss.pgh.pa.us>
To: greigwise <greigwise@comcast.net>
Cc: pgsql-general@postgresql.org
Subject: Re: Out of Memory
Date: Thu, 20 Sep 2018 18:51:11 -0400
Message-ID: <16504.1537483871@sss.pgh.pa.us> (raw)
In-Reply-To: <1537481492525-0.post@n3.nabble.com>
References: <1537481492525-0.post@n3.nabble.com>
greigwise <greigwise@comcast.net> writes:
> Hello, I'm running postgres 9.6.10 on Centos 7. Seeing the occasional out
> of memory error trying to run a query. In the logs I see something like
> this:
> Grand total: 462104832 bytes in 795 blocks; 142439136 free (819860 chunks);
> 319665696 used
> 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname ERROR: out of memory
> 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname DETAIL: Failed on request
> of size 2016.
> If I have 142439136 free, then why am I failing on a request of size 2016?
The free space must be in contexts other than the one that last little
request wanted space in. Overall, you've got about 460MB of space
consumed in that session, so it's not *that* surprising that you got OOM.
(At least, it's unsurprising on a 32-bit machine. If the server is
64-bit I'd have thought the kernel would be a bit more liberal.)
But anyway, this looks like a mighty inefficient usage pattern at best,
and maybe a memory leak at worst. Can you create a self-contained test
case that does this?
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: tgl@sss.pgh.pa.us, greigwise@comcast.net
Subject: Re: Out of Memory
In-Reply-To: <16504.1537483871@sss.pgh.pa.us>
References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@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