Ever seen OOM killer pick a process while it is core dumping to tmpfs?

From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 09/15/05


Date: Thu, 15 Sep 2005 12:09:10 +0200

I tell you, it ain't a pretty sight.

I was testing some code on some large amounts of data.
Eventually it would overflow a buffer (I know, I'd better
fix that bug ASAP). So it started dumping core to the
current directory, which happened to be the tmpfs mounted
on /tmp. Soon it ran out of swap. (I have 1280MB of RAM
and 2GB of swap, the process used about 2GB of virtual
memory when it crashed). The OOM killer quickly realized
which process was responsible for the system running out
of virtual memory and wanted to kill it. However it just
kept allocating more swap as /tmp/core needed to grow.

Are there some good changes one could make to the kernel
to prevent such a case from getting out of hand? Maybe
have tmpfs report ENOSPC in such a case. But should it
report ENOSPC to all processes, or just the one picked
by the OOM killer?

-- 
Kasper Dupont
Note to self: Don't try to allocate
256000 pages with GFP_KERNEL on x86.


Relevant Pages

  • Re: [patch 2/3][rfc] swap: try to reuse freed slots in the allocation area
    ... But the clustered slot allocation will go ahead allocating after this ... cluster offset to it. ... context when reading surrounding swap slots optimistically. ... so as not to stop at the holes. ...
    (Linux-Kernel)
  • Re: Malloc/Free - freeing memory allocated by malloc
    ... Dan Pop wrote: ... >>memory before allocating it to another program. ... >>swap space. ... from synergy, and Computer Science student from State ...
    (comp.lang.c)
  • Re: [9fans] Swap considered harmful (Sorry)
    ... i typically run with 128MB real memory and 750MB of swap *used* ... I think I prefer 'no swap and panic' to 'kill random processes'. ... differentiate between OOM killer and uncorrectable ECC errors. ... I'm loving those versioned symbols more than ever. ...
    (comp.os.plan9)
  • Re: swap space
    ... >> We made the mistake however of just allocating 512MB swap as we did not ... >> know accurately at the time of installation what the resouce requires are ... > swap space. ... I suppose I should recompile and add SYSV ...
    (freebsd-questions)
  • Re: Allocating memory on pages, mapped into process memory on demand
    ... > amount of memory and isn't cabable to swap it away. ... The size of a tmpfs can be specified at mount time, ... > My whish in this would be a syscall, allocating n pages, returning a ... that can be used transparently with mmap. ...
    (comp.os.linux.development.apps)