Re: Memory growth using many named prepared statements, in spite of using DISCARD ALL afterwards. - Mailing list pgsql-performance

From Heikki Linnakangas
Subject Re: Memory growth using many named prepared statements, in spite of using DISCARD ALL afterwards.
Date
Msg-id 8d95503f-2d50-44e0-8001-10b58cb489dc@iki.fi
Whole thread Raw
In response to Memory growth using many named prepared statements, in spite of using DISCARD ALL afterwards.  (Daniel Blanch Bataller <daniel.blanch@hoplasoftware.com>)
Responses Re: Memory growth using many named prepared statements, in spite of using DISCARD ALL afterwards.  (Daniel Blanch Bataller <daniel.blanch@hoplasoftware.com>)
List pgsql-performance
On 01/02/2024 15:40, Daniel Blanch Bataller wrote:
> We have attached a small C program with libpq that demonstrates this 
> issue, along with the program's output and the execution of the "ps aux" 
> program.

There is no DISCARD ALL command in the test program you included. I can 
see the DISCARD ALL in the log output, however. Perhaps you included a 
wrong version of the test program?

In any case, it's notoriously hard to measure memory usage of backend 
processes correctly. The resident size displayed by tools like 'ps' and 
'top' includes shared memory, too, for example.

I'd recommend that you run the test much longer, and observe the memory 
usage for a much longer period of time. I would expect it to eventually 
stabilize at some reasonable level.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




pgsql-performance by date:

Previous
From: Daniel Blanch Bataller
Date:
Subject: Memory growth using many named prepared statements, in spite of using DISCARD ALL afterwards.
Next
From: "James Pang (chaolpan)"
Date:
Subject: RE: huge SubtransSLRU and SubtransBuffer wait_event