Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 35738b5

Browse files
committed
Document how to prevent PostgreSQL itself from exhausting memory.
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.
1 parent 3e6eb0d commit 35738b5

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

doc/src/sgml/runtime.sgml

+16-2
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,9 @@ default:\
12031203
optimal for <productname>PostgreSQL</productname>. Because of the
12041204
way that the kernel implements memory overcommit, the kernel might
12051205
terminate the <productname>PostgreSQL</productname> postmaster (the
1206-
master server process) if the memory demands of
1207-
another process cause the system to run out of virtual memory.
1206+
master server process) if the memory demands of either
1207+
<productname>PostgreSQL</productname> or another process cause the
1208+
system to run out of virtual memory.
12081209
</para>
12091210

12101211
<para>
@@ -1231,6 +1232,19 @@ Out of Memory: Killed process 12345 (postgres).
12311232
swap space are exhausted.
12321233
</para>
12331234

1235+
<para>
1236+
If <productname>PostgreSQL</productname> itself is the cause of the
1237+
system running out of memory, you can avoid the problem by changing
1238+
your configuration. In some cases, it may help to lower memory-related
1239+
configuration parameters, particularly
1240+
<link linkend="guc-shared-buffers"><varname>shared_buffers</></link>
1241+
and <link linkend="guc-work-mem"><varname>work_mem</></link>. In
1242+
other cases, the problem may be caused by allowing too many connections
1243+
to the database server itself. In many cases, it may be better to reduce
1244+
<link linkend="guc-max-connections"><varname>max_connections</></link>
1245+
and instead make use of external connection-pooling software.
1246+
</para>
1247+
12341248
<para>
12351249
On Linux 2.6 and later, it is possible to modify the
12361250
kernel's behavior so that it will not <quote>overcommit</> memory.

0 commit comments

Comments
 (0)