Re: Using a lot of memory in each session. - Mailing list pgsql-bugs

From Andres Freund
Subject Re: Using a lot of memory in each session.
Date
Msg-id s7jt6f4ouxc4prjgimdyie27zbugt6jy7d3bcmmeqdor42jdkm@wub45x4r6rxm
Whole thread Raw
List 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



pgsql-bugs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Using a lot of memory in each session.
Next
From: PG Bug reporting form
Date:
Subject: BUG #18630: Incorrect memory access inside ReindexIsProcessingIndex() on VACUUM