Re: PostgreSQL 14.4 ERROR: out of memory issues

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aleš Zelený <zeleny(dot)ales(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues
Date: 2022-07-18 14:25:36
Message-ID: 695843.1658154336@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= <zeleny(dot)ales(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Millas 2022-07-18 17:08:17 postgis
Previous Message Aleš Zelený 2022-07-18 14:05:25 Re: PostgreSQL 14.4 ERROR: out of memory issues