po 18. 7. 2022 v 16:25 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
Aleš Zelený <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?
From previous observation I know, that the process RssAnon memory grew over time, sometimes there are some steps. Still, generally, the growth is linear until the process finishes or we run out of memory, and the cluster is reinitialized by the postmaster.
No such behavior on older versions until 14.3 (including).
... Probably the 838M chunk is shared memory? Is that within hailing distance of your shared_buffers setting?
postgres=# show shared_buffers ; shared_buffers ---------------- 10GB (1 row)
... > 00007fd9b0551000 10827040K rw-s- zero (deleted)
These 10GB matches 10GB configured as shared buffers.
... 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.