Re: Some questions about linux kernel.

From: James Sutherland (jas88@cam.ac.uk)
Date: Tue Mar 21 2000 - 06:59:36 EST


On Mon, 20 Mar 2000 16:52:03 -0600 (CST), you wrote:

>One thing I find disturbing about this whole debate is the assumption that
>the only valid response a program can make to running out of memory is to
>crash- and that it doesn't matter if the crash is a SEGV or a more
>controlled cleanup & exit.
>
>One can even imagine better responses a program might have to being unable
>to allocate memory than simply exit, too- initiating a garbage collection
>to free up it's own internal memory, or having a prepared dialog box that
>it can show that says "Unable to allocate memory- please close some other
>programs and try again".

It's too late for garbage collection at this point. I would prefer a
SIGTERM; the process can then attempt some sort of graceful exit (save
the current file, whatever), followed by a SIGKILL.

Someone suggested something similar to SIGDANGER to indicate low
memory, triggering any garbage collection routines you may have. This
would be a better approach; try SIGDANGER, see if that helped. If not,
SIGTERM. If that still hasn't freed anything, SIGKILL.

James.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:32 EST