In comp.os.linux.setup, Bill
<galaxyblue63.DeleteThis@gmail.com>
wrote
on Wed, 01 Aug 2007 10:31:52 -0700
<1185989512.821338.45970.DeleteThis@i38g2000prf.googlegroups.com>:
> What can a process do to insure that it is the process which dies
> when the system runs out of memory. (This is as opposed to invoking
> the out-of-memory kill and sacrificing some other program.)
>
> I am interested in suggestions which involve changing the processes
> environment rather than editing the applications source code and
> making
> changes there.
>
> Thanks.
>
> Bill
>
The concept you're apparently looking for appears to be
called "overcommit", and apparently can be adjusted
by the command
sysctl -w vm.overcommit_memory=mode
where mode is one of the following:
0 - Heuristic overcommit handling. Obvious overcommits of
address space are refused. Used for a typical system. It
ensures a seriously wild allocation fails while allowing
overcommit to reduce swap usage. root is allowed to
allocate slighly more memory in this mode. This is the
default.
1 - No overcommit handling. Appropriate for some scientific
applications.
2 - (NEW) strict overcommit. The total address space commit
for the system is not permitted to exceed swap + a
configurable percentage (default is 50) of physical RAM.
Depending on the percentage you use, in most situations
this means a process will not be killed while accessing
pages but will receive errors on memory allocation as
appropriate.
http://archives.postgresql.org/pgsql-patches/2003-11/msg00194.php
http://www.network-theory.co.uk/docs/postgresql/vol3/LinuxMemoryOvercommit.html
There is a patch if one needs a per-user overcommit policy
(the default affects the entire system):
http://lwn.net/Articles/233317/
I disclaim any knowledge of the details, of course, but it
might be worth looking at.
--
#191, ewill3.DeleteThis@earthlink.net
Linux. Because life's too short for a buggy OS.
--
Posted via a free Usenet account from
http://www.teranews.com