Hello, I'm inquiring because of using a lot of memory in each session.


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.


We're wondering what are the things that are occupied in session memory and if there is a way to organize these in each session and return the memory.


2. PostgreSQL version number you are running:


PostgreSQL 15.3 (Ubuntu 15.3-1.pgdg22.04+~20230706.1614.g25624c5) on aarch64-unknown-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0, 64-bit


3. How you installed PostgreSQL:


We have downloaded debs on https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-15/


and installed them.


4. Changes made to the settings in the postgresql.conf file:


namecurrent_settingsource
archive_commandcp /data/PG15/pg_wal/%f /archive_data/%fconfiguration file
archive_modeonconfiguration file
auto_explain.log_analyzeonconfiguration file
auto_explain.log_buffersonconfiguration file
autovacuum_analyze_scale_factor0configuration file
autovacuum_analyze_threshold100000000configuration file
autovacuum_freeze_max_age500000000configuration file
autovacuum_max_workers3configuration file
autovacuum_naptime1minconfiguration file
autovacuum_vacuum_cost_delay50msconfiguration file
autovacuum_vacuum_insert_scale_factor0configuration file
autovacuum_vacuum_insert_threshold30000configuration file
autovacuum_vacuum_scale_factor0configuration file
autovacuum_vacuum_threshold5000configuration file
checkpoint_warning1hconfiguration file
client_encodingUTF8client
DateStyleISO, MDYclient
deadlock_timeout100msconfiguration file
default_text_search_configpg_catalog.englishconfiguration file
dynamic_shared_memory_typeposixconfiguration file
effective_cache_size48GBconfiguration file
effective_io_concurrency600configuration file
enable_mergejoinoffconfiguration file
enable_seqscanoffconfiguration file
extra_float_digits3session
jitoffconfiguration file
lc_messagesen_US.UTF-8configuration file
lc_monetaryen_US.UTF-8configuration file
lc_numericen_US.UTF-8configuration file
lc_timeen_US.UTF-8configuration file
listen_addresses*configuration file
log_autovacuum_min_duration10msconfiguration file
log_checkpointsonconfiguration file
log_destinationstderr, csvlogconfiguration file
log_directory/data/logconfiguration file
log_filenamepostgresql-%a.logconfiguration file
log_line_prefix%m [%p][%u][%h]configuration file
log_lock_waitsonconfiguration file
log_min_duration_statement1500msuser
log_min_messageswarningconfiguration file
log_rotation_age1dconfiguration file
log_rotation_size0configuration file
log_timezoneAsia/Seoulconfiguration file
log_truncate_on_rotationonconfiguration file
logging_collectoronconfiguration file
maintenance_work_mem200MBconfiguration file
max_connections

300

configuration file
max_locks_per_transaction2000configuration file
max_parallel_workers0configuration file
max_parallel_workers_per_gather0configuration file
max_wal_size2GBconfiguration file
max_worker_processes50configuration file
min_wal_size1GBconfiguration file
password_encryptionmd5configuration file
plan_cache_modeforce_custom_planconfiguration file
port45432configuration file
restore_commandmv -f /archive_data/%f /data/PG15/pg_wal/%fconfiguration file
shared_buffers70GBconfiguration file
shared_preload_librariespg_hint_plan, pg_cron, pg_stat_statements, auto_explainconfiguration file
superuser_reserved_connections6configuration file
tcp_keepalives_idle30configuration file
tcp_keepalives_interval1configuration file
TimeZoneAsia/Seoulclient
vacuum_cost_limit1000configuration file
wal_buffers1GBconfiguration file
wal_compressionzstdconfiguration file
wal_sender_timeout10minconfiguration file
work_mem200MBconfiguration file


5. Operating system and version:

Distributor ID: Ubuntu

Description:    Ubuntu 22.04.2 LTS

Release:        22.04

Codename:       jammy


6. What program you're using to connect to PostgreSQL:


Just do on Linux kernel