Document how to prevent PostgreSQL itself from exhausting memory.
authorRobert Haas
Thu, 30 Aug 2012 18:14:22 +0000 (14:14 -0400)
committerRobert Haas
Thu, 30 Aug 2012 18:23:19 +0000 (14:23 -0400)
The existing documentation in Linux Memory Overcommit seemed to
assume that PostgreSQL itself could never be the problem, or at
least it didn't tell you what to do about it.

Per discussion with Craig Ringer and Kevin Grittner.

doc/src/sgml/runtime.sgml

index 7ba18f03197f6c22333181129652d79c8580f3f6..ff8ef7ed4037cf9576ba8691e1bf2034f8cd3a78 100644 (file)
@@ -1269,8 +1269,9 @@ default:\
     optimal for PostgreSQL. Because of the
     way that the kernel implements memory overcommit, the kernel might
     terminate the PostgreSQL postmaster (the
-    master server process) if the memory demands of
-    another process cause the system to run out of virtual memory.
+    master server process) if the memory demands of either
+    PostgreSQL or another process cause the
+    system to run out of virtual memory.
    
 
    
@@ -1297,6 +1298,19 @@ Out of Memory: Killed process 12345 (postgres).
     swap space are exhausted.
    
 
+   
+    If PostgreSQL itself is the cause of the
+    system running out of memory, you can avoid the problem by changing
+    your configuration.  In some cases, it may help to lower memory-related
+    configuration parameters, particularly
+    shared_buffers
+    and work_mem.  In
+    other cases, the problem may be caused by allowing too many connections
+    to the database server itself.  In many cases, it may be better to reduce
+    max_connections
+    and instead make use of external connection-pooling software.
+   
+
    
     On Linux 2.6 and later, it is possible to modify the
     kernel's behavior so that it will not overcommit memory.