Re: Memory hogs

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Sat, 17 Jul 1999 07:48:01 +0200 (MEST)


Rik van Riel wrote:
> On Fri, 16 Jul 1999, Rogier Wolff wrote:
>
> [warning shot]
> > > That can be added without much effort. The real hard part has
> > > been in getting the 'task chooser' right...
> >
> > That really isn't easy.
> >
> > You're in a "we're completely out of memory" situation already, and
> > having the application clean up may mean it wants to rewrite its
> > config files. Requiring buffers and other resources.
>
> Once you're completely out of memory, you're too late. We
> can simply start killing once we get very very near...

That sounds much easier than it is. Once your "near", the machine is
swapping as if its life depends on it (which happens to be the case :-).

So you decide to shoot my xfig. It wants to save my work. How long do
you think it needs? How long do you think we've got? Oh, normally my
file would save in a fraction of a second, but under these
circumstances (extremely low on memory) it can easily take tens of
seconds. If your aim was correct (i.e. you shot the one bogus program)
the program will not react and continue to eat resources. You're going
to have to force the situation soon.

If your aim was not correct, we have a rogue program still eating
resources like mad, together with a just wokenup xfig trying its best
to save my work.

What I can immagine to work, is to change the system to "single-user"
mode quicly. You select one program, and politely kill it. You also
switch to this single-user mode. Now every memory allocation will
block until we're out of the single-user mode. Only our selected
program is allowed to continue. That reduces swapping. That makes sure
that the other processes don't grab resources we need for this program
to finish writing my work.

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------

- 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/