Messages in this thread |  | | From | (Dale R. Worley) | Subject | Re: Behavior under swap catastrophe? | Date | Thu, 13 Feb 1997 15:28:23 GMT |
| |
In article <Mutt.19970212155407.jf@helix.caltech.edu> jf@ugcs.caltech.edu (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 -- Dale R. Worley Ariadne Internet Services Voice: +1 617-899-7949 Fax: +1 617-899-7946 E-mail: worley@ariadne.com "Internet-based electronic commerce solutions to real business problems."
|  |