Getting OOM errors from PostgreSQL - Mailing list pgsql-admin

From Chris Lajoie
Subject Getting OOM errors from PostgreSQL
Date
Msg-id 77b989891467460b9e1dede8fedd25f1@etriptrader.com
Whole thread Raw
Responses Re: Getting OOM errors from PostgreSQL
List pgsql-admin
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


pgsql-admin by date:

Previous
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: autovacuum disk IO
Next
From: Kevin Grittner
Date:
Subject: Re: Getting OOM errors from PostgreSQL