mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Pedro <linux_user@izecksohn.com>, linux-kernel@vger.kernel.org
Subject: Re: tmpfs and the OOM killer
Date: Thu, 12 Apr 2007 10:19:31 +0200	[thread overview]
Message-ID: <20070412081931.GB9842@1wt.eu> (raw)
In-Reply-To: <Pine.LNX.4.61.0704121011370.20436@yvahk01.tjqt.qr>

On Thu, Apr 12, 2007 at 10:13:05AM +0200, Jan Engelhardt wrote:
> 
> On Apr 11 2007 21:48, Willy Tarreau wrote:
> >On Wed, Apr 11, 2007 at 02:23:31AM -0300, Pedro wrote:
> >>   After suffering some days from a not|mis configured tmpfs,
> >> 
> >>   As the OOM killer is not Posix,
> >> 
> >>   Better than to kill processes would be to resize tmpfs, to use tmpfs empty 
> >> space.
> >
> >Will not work, because tmpfs does not use any memory for unused space. If
> >you don't believe me, simply create a large file on your tmpfs, then check
> >free memory, then remove the file and check free memory again.
> >
> >So your problem is not caused by the empty space on tmpfs, but either by
> >too much space used on tmpfs or by your application using too much memory.
> >
> >>   I'm using kernel 2.6.20.4. If someone ask I'll send a test application.
> >
> >Not needed, the one-liner "main(){while(malloc(4096));}" is enough to
> >trigger an OOM.
> 
> No, that won't do anything, malloc happily returns NULL after a few seconds.
> 
> int main()
> {
> 	while(1) {
> 		char *p = malloc(4096);
> 		*p = 1;
> 	}
> }
> 
> This is more likely to trigger OOM, because it actually dirties the page.

Yes, you're right, and that's indeed what my "freemem" program does ;-)

Willy


  reply	other threads:[~2007-04-12  8:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11  5:23 Pedro
2007-04-11 19:48 ` Willy Tarreau
2007-04-11 21:05   ` Mouawad, Tony
2007-04-11 22:27   ` Pedro
2007-04-11 22:39     ` Alan Cox
2007-04-12  5:19       ` Pedro
2007-04-12  9:42         ` Alan Cox
2007-04-12 15:08           ` Pedro
2007-04-12 11:25         ` Theodore Tso
2007-04-12 14:35           ` Pedro
2007-04-12 20:31             ` Willy Tarreau
2007-04-12 20:56               ` Mouawad, Tony
2007-04-12 21:09                 ` Willy Tarreau
2007-04-12  8:13   ` Jan Engelhardt
2007-04-12  8:19     ` Willy Tarreau [this message]
2007-04-12  5:04 Al Boldi
2007-04-12  5:39 ` Pedro

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=20070412081931.GB9842@1wt.eu \
    --to=w@1wt.eu \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_user@izecksohn.com \
    /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®