Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jul 1996 09:16:36 -0700
From:      David Greenman <dg@root.com>
To:        Juri Tsibrovski <jt@sw.ru>
Cc:        questions@FreeBSD.ORG
Subject:   Re: Considering FreeBSD 
Message-ID:  <199607311616.JAA01727@root.com>
In-Reply-To: Your message of "Wed, 31 Jul 1996 16:24:07 %2B0400." <2.2.32.19960731122407.00b12a5c@myth.sw.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
>At 00:06 29.07.96 -0700, David Greenman wrote:
>>>On Fri, 26 Jul 1996, Paul J. Mech wrote:
>>>
>>>> 0) When Linux runs out of virtual memory, it crashes.  What is FreeBSD's
>>>> behavior under these conditions?
>>>
>>>FreeBSD will start killing processes until the memory problem is resolved.
>>>This usually means the program that is trying to start, and working
>>>backward.  Occaisionally the VM system gets too busy and kills init, but
>>>that is very rare.
>>
>>   FreeBSD will never kill init or any process whose process id is less than
>>48. In the extremely unlikely event that the process consuming all the memory
>>has a pid less than 48, the system will hang. This is extremely unlikely
>>because when the pids wrap at 32767, then wrap back to 100, so usually only
>>processes that were started at system startup time will have pids < 100.
>>
>
>Is 48 a kind of magic number? Last night  one of our machines eventually run
>out of VM, then inetd (pid 91) and tac_plus (authorization and
>authentification daemon for our terminal servers, pid 190) got killed. Now
>I'm seriously considering modifying the source code to protect more
>processes from being killed.

   No magic. It's just a value that seemed reasoonable at the time. Some
systems may create daemons with PIDs >48, so perhaps the value should be
increased a bit. YMMV.

>So, what's the Pros et Contra, besides the risc of system crash when one of
>that processes going crazy? Any other solution?

   The worst that will happen is that the system will hang due to virtual
memory exhaustion. You should not increase it to >99, however, as 100 is
the starting point after it wraps at 30000 and thus may protect processes
that shouldn't be protected.
   The whole thing is admittedly somewhat of a kludge, but it actually handles
about 98% of the failure cases and is a far better solution (killing off the
process that faults when VM is exhausted) than hanging or crashing the system.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607311616.JAA01727>