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 10:25:36 -0400
Message-ID: <695843.1658154336@sss.pgh.pa.us> (raw)
In-Reply-To: <CAODqTUZ+pxQVKwOa-H4vSP+dbpLpQv-XyGp2Kbgp1H8fQ69oCQ@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>

=?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= <zeleny.ales@gmail.com> writes:
> after some time, I've found a process consuming over 1GB of memory"
> -bash-4.2$ grep RssAnon /proc/*/status | sort -nk2 | tail
> /proc/17048/status:RssAnon: 1053952 kB

> Here are memory contexts for PID 17048:

> TopMemoryContext: 422592 total in 14 blocks; 42536 free (169 chunks);
> 380056 used
...
> Grand total: 14312808 bytes in 4752 blocks; 3920880 free (1043 chunks);
> 10391928 used

OK, so PG's normal memory consumption is only ~14MB.  Where'd the
rest of it go?

> -bash-4.2$ pmap 17048
...
> 0000000002d93000 838092K rw---   [ anon ]
> 00007fd999777000 180232K rw---   [ anon ]
> 00007fd9a8d75000  32772K rw---   [ anon ]
...
Probably the 838M chunk is shared memory?  Is that within hailing
distance of your shared_buffers setting?
...
> 00007fd9b0551000 10827040K rw-s- zero (deleted)
...
And here we have the culprit, evidently ... but what the dickens
is it?  I can't think of any mechanism within Postgres that would
create such an allocation.

			regards, tom lane





view thread (22+ messages)  latest in thread

Message-ID: <695843.1658154336@sss.pgh.pa.us>
Permalink:  ../695843.1658154336@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/695843.1658154336@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: <695843.1658154336@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>

* 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