We have a postgres 9.0 instance that is running on a pretty beefy machine (96G of RAM/24 cores). IN the recent weeks we have experienced crashes due to child processes of postgres being killed with out of memory by OOM killer. It seems that due to using connection pooling, those child processes are long-lived (which makes sense, since opening and closing the connections takes time), the problem is that they are gradually growing in memory consumption to reach even 9Gigs/process. As you may imagine, having 10 of those, fills up the available ram and oom-killer kicks in.
The questions are:
- if we are using the default config parameter, how is it possible for the process to allocate so much memory?
- why are those processes not freeing the memory ever?
For reference, settings that can influence memory:
max_connections = 950 shared_buffers = 32MB
All other settings are not overridden, meaning we are using defaults.