[lkml]   [1997]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Behavior under swap catastrophe?
In article <> (Joe Fouche) writes:
I've noticed lately that the behavior of the kernel when some
process goes berserk and fills up all the swap is a little
strange. It seems to start sending SEGV's to many processes as the
large one grows. This wouldn't be so bad, except that init is often
killed. Is a modification to protect the life of init in order? Or
should we just make sure this never happens?

My suspicion is that it is not really the kernel sending SEGV's, but
rather that the programs are calling malloc, which discovers that it
cannot grab more virtual memory, and so returns NULL to its caller.
The caller, blithely ignoring warnings to always check malloc's return
value, attempts to use it and promptly segment-faults.

Supposedly, if virtual memory runs out, Unix is supposed to kill off
processes, starting with the most recently initiated one. Since init
is the oldest process, it is safe.

None of this explains why init dies. Perhaps init is not checking the
return value from malloc?

Dale R. Worley Ariadne Internet Services
Voice: +1 617-899-7949 Fax: +1 617-899-7946 E-mail:
"Internet-based electronic commerce solutions to real business problems."

 \ /
  Last update: 2005-03-22 13:38    [W:0.121 / U:2.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site