Re: Using a lot of memory in each session.

From: Andres Freund <andres(at)anarazel(dot)de>
To: DBA <ecountdba(at)ecounterp(dot)co(dot)kr>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Using a lot of memory in each session.
Date: 2024-09-24 16:13:05
Message-ID: s7jt6f4ouxc4prjgimdyie27zbugt6jy7d3bcmmeqdor42jdkm@wub45x4r6rxm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2024-09-24 16:58:11 +0900, DBA wrote:
> 1. A description of what you are trying to achieve and what results you expect
> :
>
>
> We set shared_buffer = 70GB, max_connections = 300, work_mem = 300MB.
>
>
> We thought the session memory could be adjusted with the work_mem variable, but
> no. noticed that each session consumed more than 500MB.

How did you determine you're using a lot of memory in each session? Unless you
use huge pages, the first access to a shared memory page in a process will
start to attribute the shared memory to the RES (or RSS) of a process as shown
in top/ps.

See
https://postgr.es/m/p3wmyj7cllclyxgebcqilds5f25yfuyozwerel4no54k5oro6f%40ly5ivt67icfb
for a bit more detail.

Greetings,

Andres Freund

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2024-09-24 23:10:16 Re: vacuumdb: permission denied for schema "pg_temp_7"
Previous Message Laurenz Albe 2024-09-24 15:45:14 Re: Using a lot of memory in each session.