When I start Postgres DB in my machine, by default it creates 7 processes.
I understand that one among these processes is the main Postgres process and the remaining are background processes used by Postgres itself.
When my C# application connects to this Postgres DB instance and opens a connection, additional Postgres backend processes are getting created and it consumes some memory and finally when the connection is closed, these processes are getting killed and the memory they consumed is getting released.
But what I could observe is that, the memory consumption of the original 7 processes that Postgres created gradually increases and it is not getting released and due to this the system is eventually running out of memory.
Below is a screenshot of the Postgres instance that has been running in Docker for a few hours. As you can see it has consumed around 1.5GB of memory and there are only two additional processes apart from the 7 original processes. This memory will never be released and will keep adding up.
Is it normal for the default Postgres processes to consume this much memory and not release it? Or, am I doing something wrong with respect to handling the connections from the C# application (unlikely because the processes corresponding to these connections are getting killed and the corresponding memory is getting released) Or is the Postgres instance not configured correctly with the right configuration for my machine ?
Any advice/help would be much appreciated.