LWN.net Logo

Re: [PATCH v3] oom-kill: add lowmem usage aware oom kill handling

From:  Alan Cox <alan-AT-lxorguk.ukuu.org.uk>
To:  vedran.furac-AT-gmail.com
Subject:  Re: [PATCH v3] oom-kill: add lowmem usage aware oom kill handling
Date:  Fri, 29 Jan 2010 11:03:21 +0000
Cc:  KAMEZAWA Hiroyuki <kamezawa.hiroyu-AT-jp.fujitsu.com>, Andrew Morton <akpm-AT-linux-foundation.org>, "linux-mm-AT-kvack.org" <linux-mm-AT-kvack.org>, rientjes-AT-google.com, minchan.kim-AT-gmail.com, "linux-kernel-AT-vger.kernel.org" <linux-kernel-AT-vger.kernel.org>, "balbir-AT-linux.vnet.ibm.com" <balbir-AT-linux.vnet.ibm.com>
Archive-link:  Article, Thread

> off by default. Problem is that it breaks java and some other stuff that
> allocates much more memory than it needs. Very quickly Committed_AS hits
> CommitLimit and one cannot allocate any more while there is plenty of
> memory still unused.

So how about you go and have a complain at the people who are causing
your problem, rather than the kernel.

> > theoretical limit, but you generally need more swap (it's one of the
> > reasons why things like BSD historically have a '3 * memory' rule).
> 
> Say I have 8GB of memory and there's always some free, why would I need
> swap?

So that all the applications that allocate tons of address space and
don't use it can swap when you hit that corner case, and as a result you
don't need to go OOM. You should only get an OOM when you run out of
memory + swap.

> > So sounds to me like a problem between the keyboard and screen (coupled
> 
> Unfortunately it is not. Give me ssh access to your computer (leave
> overcommit on) and I'll kill your X with anything running on it.

If you have overcommit on then you can cause stuff to get killed. Thats
what the option enables.

It's really very simple: overcommit off you must have enough RAM and swap
to hold all allocations requested. Overcommit on - you don't need this
but if you do use more than is available on the system something has to
go.

It's kind of like banking  overcommit off is proper banking, overcommit
on is modern western banking.

Alan

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>



(Log in to post comments)

Copyright © 2010, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds