mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rok Papež" <rok.papez@lugos.si>
To: linux-kernel@vger.kernel.org
Subject: Re: [2.4.18] Security: Process-Killer if machine get's out of memory
Date: Mon, 25 Mar 2002 16:09:05 +0100	[thread overview]
Message-ID: <02032516090500.02095@strader.home> (raw)
In-Reply-To: <E16pE0U-00073m-00@the-village.bc.nu>

Hello Alan and Paul.

On Sunday 24 March 2002 20:50, Alan Cox wrote:

> > How does a process react that doesn't get no more memory?
>
> Thats up to the process. If a program doesn't handle malloc/mmap/etc
> failures then its junk anyway

Agreed 101%.

On Sunday 24 March 2002 21:43, Paul P Komkoff Jr wrote:
> Replying to Alan Cox:
> > Thats up to the process. If a program doesn't handle malloc/mmap/etc
> > failures then its junk anyway
>
> The recent junk I fighting with to take full advantage of overcommit
> accounting is squid.
> Very popular junk. Maybe rsync uses same 'secret technique' to handle
> malloc failures? :)))
>
> Btw. Overcommit handling not very good yet.
> Squid hits the limit, then bails out. Then shell script trying to start new
> instance of squid (actually trying to sleep before restart), but gets
> 'fork - cannot allocate memory'. seems that memory isn't dealloced
> from already exited process space :(

In all the code I've written I always check if malloc() and friends don't 
succeed. In some instances the code can even handle this gracefully and 
malloc failure doesn't cause a fatal application error.

Now if kernel kills my process it doesn't matter if I can handle the out of 
memory condition or not. The kernel already made a decision for me instead of 
my application... and never mind the data I have cached in applications 
buffers... the kernel also decided it wasn't worth writing to a disk.

--------------------------------------------------------------------------

Alan.. I would find it acceptable if a process is killed if it tries to 
malloc() memory *after* a previous malloc has already failed and there is 
still out-of-memory condition.

-- 
best regards,
Rok Papež.

  parent reply	other threads:[~2002-03-25 15:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-24 12:09 andreas
     [not found] ` <3C9DC6D0.3080606@wanadoo.fr>
2002-03-24 13:24   ` Andreas Hartmann
     [not found]     ` <3C9DD653.8090701@wanadoo.fr>
2002-03-24 13:36       ` Andreas Hartmann
2002-03-24 13:30 ` Rik van Riel
2002-03-24 14:08   ` Andreas Hartmann
2002-03-24 16:54     ` Alan Cox
2002-03-24 16:59       ` Andreas Hartmann
     [not found]     ` <3C9E48B8.9080707@ngforever.de>
2002-03-24 22:23       ` Andreas Hartmann
2002-03-24 15:58 ` Chris Swiedler
2002-03-24 16:57 ` Alan Cox
2002-03-24 16:59   ` Roy Sigurd Karlsbakk
2002-03-24 17:45     ` Rik van Riel
2002-03-24 17:57       ` Christian Bornträger
2002-03-24 18:01         ` Rik van Riel
2002-03-24 18:03         ` Bernd Petrovitsch
2002-03-24 18:23         ` Alan Cox
2002-03-24 18:37         ` Andreas Hartmann
2002-03-24 18:20     ` Alan Cox
2002-03-24 19:20     ` Itai Nahshon
2002-03-24 17:24   ` Andreas Hartmann
2002-03-24 18:22     ` Alan Cox
2002-03-24 18:23       ` Mr. James W. Laferriere
2002-03-24 19:49         ` Alan Cox
2002-03-24 19:48           ` Mr. James W. Laferriere
2002-03-24 20:39             ` Alan Cox
2002-03-24 18:32       ` Andreas Hartmann
2002-03-24 19:50         ` Alan Cox
2002-03-24 20:43           ` Paul P Komkoff Jr
2002-03-25 15:09           ` Rok Papež [this message]
2002-03-26 20:24           ` dean gaudet
2002-03-26 23:47             ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02032516090500.02095@strader.home \
    --to=rok.papez@lugos.si \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®