lkml.org 
[lkml]   [2000]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Some questions about linux kernel.
Date
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/

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