In my log I have been getting errors that look like this:
LOG: could not fork new process for connection: Cannot allocate memory
This seems to only happen during periods of high activity. Shortly after the last one occurred I checked the free mem
andgot this:
# free -h
total used free shared buff/cache available
Mem: 9.4G 737M 283M 2.1G 8.4G 6.3G
Swap: 2.0G 8.3M 2.0G
From this I see the vast majority of the 10GB of memory is being used by the OS cache. If I understand how it works
correctly,this means it is basically free memory because if an application needs it the kernel will free some of it for
use...is my understanding correct?
Here are the memory-related settings I am using:
max_connections = 50
shared_buffers = 2000MB
maintenance_work_mem = 500MB
autovacuum_work_mem = 500MB
work_mem = 50MB
temp_buffers = 16MB
Can anyone help me determine what is causing postgresql to be unable to fork a new process because it can't allocate
memory?
Chris