pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aleš Zelený <zeleny.ales@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues
Date: Mon, 18 Jul 2022 15:03:59 -0400
Message-ID: <787006.1658171039@sss.pgh.pa.us> (raw)
In-Reply-To: <CAODqTUbB+Vt0o2kv5pvNH1XpmWf6NQR2nnkPNvjOVd17Ts6z_w@mail.gmail.com>
References: <CAODqTUaZAqkmiFpB-Sy5yqTrC6iJR1GyB5JRXLuitxJjR3_B=Q@mail.gmail.com>
	<Ys4P48i85Nn3xKpD@paquier.xyz>
	<CAODqTUbZG+Fp-NfynbATfGf0y=xsi1XfwBCDQWgXWeAcVOFXZQ@mail.gmail.com>
	<b009e8aa-6e6e-cc22-1ee1-60f8a55aacc0@enterprisedb.com>
	<CAODqTUZLeUiMFCAj8ehzTZyTYae=X5r46OmUFGbuegzrRkqt_A@mail.gmail.com>
	<CAODqTUZ+pxQVKwOa-H4vSP+dbpLpQv-XyGp2Kbgp1H8fQ69oCQ@mail.gmail.com>
	<695843.1658154336@sss.pgh.pa.us>
	<CAODqTUbB+Vt0o2kv5pvNH1XpmWf6NQR2nnkPNvjOVd17Ts6z_w@mail.gmail.com>

=?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= <zeleny.ales@gmail.com> writes:
> postgres=# show shared_buffers ;
>  shared_buffers
> ----------------
>  10GB
> (1 row)

Oh!  In that case, there is absolutely nothing to see here.
This chunk:

> 00007fd9b0551000 10827040K rw-s- zero (deleted)

must be your shared-memory region, and it's accounting for just
about all of the process's memory space.  There is no reason
to suspect a leak.

I think you've been fooled by the fact that "top" and some other
tools frequently don't report a shared-memory page as part of a
process's usage until that process touches that particular page.
Thus, the reported memory usage of a Postgres backend will grow
over time as it randomly happens to touch different buffers within
the shared buffer arena.  That does not constitute a leak, but
it does make such tools next door to useless for detecting
actual leaks :-(.  You can only believe there's a leak if the
reported usage doesn't level off after reaching the vicinity of
your shared memory size.

So back to why you're getting these out-of-memory failures:
we still don't have much info about that.  I wonder whether
there is something watching the total usage reported by "top"
and taking action based on that entirely-misleading number.
The kernel itself should be aware that there's no extra memory
pressure from N backends all using the same shared memory
segment, but it can be hard for outside tools to know that.

At this point I suspect that PG 14.3 vs 14.4 is a red herring,
and what you should be looking into is what else you updated
at about the same time, particularly in the line of container
management tools or the like (if you use any).

			regards, tom lane





view thread (22+ messages)  latest in thread

Message-ID: <787006.1658171039@sss.pgh.pa.us>
Permalink:  ../787006.1658171039@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/787006.1658171039@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 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, zeleny.ales@gmail.com, tomas.vondra@enterprisedb.com, michael@paquier.xyz
  Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues
  In-Reply-To: <787006.1658171039@sss.pgh.pa.us>
  References: <CAODqTUaZAqkmiFpB-Sy5yqTrC6iJR1GyB5JRXLuitxJjR3_B=Q@mail.gmail.com> <Ys4P48i85Nn3xKpD@paquier.xyz> <CAODqTUbZG+Fp-NfynbATfGf0y=xsi1XfwBCDQWgXWeAcVOFXZQ@mail.gmail.com> <b009e8aa-6e6e-cc22-1ee1-60f8a55aacc0@enterprisedb.com> <CAODqTUZLeUiMFCAj8ehzTZyTYae=X5r46OmUFGbuegzrRkqt_A@mail.gmail.com> <CAODqTUZ+pxQVKwOa-H4vSP+dbpLpQv-XyGp2Kbgp1H8fQ69oCQ@mail.gmail.com> <695843.1658154336@sss.pgh.pa.us> <CAODqTUbB+Vt0o2kv5pvNH1XpmWf6NQR2nnkPNvjOVd17Ts6z_w@mail.gmail.com> <787006.1658171039@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