Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0ba70d

Browse files
committed
Update information about Linux's overcommit memory behavior.
Andrew Dunstan
1 parent5b49f90 commitb0ba70d

File tree

1 file changed

+53
-6
lines changed

1 file changed

+53
-6
lines changed

‎doc/src/sgml/runtime.sgml

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.201 2003/08/31 17:32:19 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.202 2003/09/05 02:54:09 momjian Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -3081,14 +3081,61 @@ kernel.shmmax = 134217728
30813081
</para>
30823082

30833083
<para>
3084-
Linux has poor default memory overcommit behavior. Rather than
3085-
failing if it can not reserve enough memory, it returns success,
3086-
but later fails when the memory can't be mapped and terminates
3087-
the application with <literal>kill -9</>. To prevent unpredictable
3088-
process termination, use:
3084+
Linux kernel version 2.4.* has poor default memory overcommit
3085+
behavior, which can result in the postmaster being killed by the
3086+
kernel due to memory demands by another process if the system
3087+
runs out of memory.
3088+
</para>
3089+
3090+
<para>
3091+
The symptom of this occuring is a kernel message looking like
3092+
this (consult your system documentation and configuration on
3093+
where to look for such a message):
3094+
<programlisting>
3095+
Out of Memory: Killed process 12345 (postmaster).
3096+
</programlisting>
3097+
</para>
3098+
3099+
<para>
3100+
To avoid this situation, run <productname>PostgreSQL</productname>
3101+
on a machine where you
3102+
can be sure that other processes will not run the machine out
3103+
of memory. If your kernel supports strict and/or paranoid modes
3104+
of overcommit handling, you can also relieve this problem by
3105+
altering the system's default behaviour. This can be determined
3106+
by examining the function <function>vm_enough_memory</>
3107+
in the file <filename>mm/mmap.c</>in the kernel source.
3108+
If this file reveals that strict and/or paranoid modes are
3109+
supported by your kernel, turn one of these modes on by using
3110+
<programlisting>
3111+
sysctl -w vm.overcommit_memory=2
3112+
</programlisting>
3113+
for strict mode or
30893114
<programlisting>
30903115
sysctl -w vm.overcommit_memory=3
30913116
</programlisting>
3117+
for paranoid mode, or placing an equivalent entry in
3118+
<filename>/etc/sysctl.conf</>.
3119+
</para>
3120+
3121+
<note>
3122+
<para>
3123+
Warning: using these settings in a kernel which does not support
3124+
these modes will almost certainly increase the danger of the
3125+
kernel killing the postmaster, rather than reducing it.
3126+
If in any doubt, consult a kernel expert or your kernel vendor.
3127+
</para>
3128+
</note>
3129+
3130+
<para>
3131+
These modes are expected to be supported in all 2.6 and later
3132+
kernels. Some vendor 2.4 kernels may also support these modes.
3133+
However, it is known that some vendor documents suggest that
3134+
they support them while examination of the kernel source reveals
3135+
that they do not.
3136+
</para>
3137+
3138+
<para>
30923139
Note, you will need enough swap space to cover all your memory needs.
30933140
</para>
30943141
</listitem>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp