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)