RE: BUG #16831: Idle postgres processes on Linux consumes huge amount of memory - Mailing list pgsql-bugs

From Li, Yaqing
Subject RE: BUG #16831: Idle postgres processes on Linux consumes huge amount of memory
Date
Msg-id DM6PR19MB40587A5954FCBDAC486AE151F7A19@DM6PR19MB4058.namprd19.prod.outlook.com
Whole thread Raw
In response to Re: BUG #16831: Idle postgres processes on Linux consumes huge amount of memory  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Thanks Tom!
Sorry, the link is this one:
https://dba.stackexchange.com/questions/185880/analyze-memory-usage-of-postgresql-why-is-it-growing-constantly

The memory report is on the same system, the only difference is the memory setting. Even if on the same 32GB system,  I
changedthe database memory setting, the postgres memory consumption difference is unproportioned, just the same as I
reported,what is the reason for that? 

Yaqing

-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Wednesday, January 20, 2021 6:19 PM
To: Li, Yaqing
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16831: Idle postgres processes on Linux consumes huge amount of memory


[EXTERNAL EMAIL]

PG Bug reporting form <noreply@postgresql.org> writes:
> We are still using postgresql 9.4.1, however, it looks the same issue
> as in
> 9.5 as someone reported:
> https://www.postgresql.org/account/reset/NzAyMjY-5ng-2bb43dc39c9c2c644
> a7a/

That link's not too helpful: it leads to a "password reset" form.

> The postgres process consume huge memory as following for the same
> database size
>    PID=6840 - Swap used: 145860 KB - (postgres)
>    PID=6842 - Swap used: 142564 KB - (postgres)
>     PID=6841 - Swap used: 141620 KB - (postgres)

Almost invariably, when we hear reports like this, the true reason is somebody misunderstanding the numbers they are
lookingat. 
Many Unix tools such as "top" will count the shared memory segment as memory consumed by each Postgres process, even
thoughin reality there's only one copy of the shared memory. 

I don't know what these "Swap used" numbers are coming out of, but it'd be wise to check into how the tool accounts for
sharedmemory before putting much faith in them. 

            regards, tom lane



pgsql-bugs by date:

Previous
From: Sergey Mirvoda
Date:
Subject: Re: Проблемы с Postgresql 11
Next
From: Merlin Moncure
Date:
Subject: Re: Problem with database