Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Locking processes against being killed when low on memory

On Thu, 21 Feb 2008, Gary Thorpe wrote:
--- Stephen Borrill <> wrote:

I'm using NetBSD 4.0 with Xorg, etc. running from flash, i.e. no
swap. As
it's embedded, everything is running as root. Is there any way to tag

processes as unkillable when running out of memory? Some processes
the X server, management daemon and session manager) need to remain
running throughout. I don't mind if other things such as web-browsers
killed. Currently bad things happen when it starts to run out of


I don't think NetBSD has an "out-of-memory" killer (as in Linux?): I
think the application which causes the unserviceable page fault is just
killed. If I am not mistaken in this, you cannot predict beforehand
which applications will be targeted (this includes 'init') because any
of them may try to access over-committed memory. Maybe you could try
'ulimit' to make sure the memory usage is contained? This may be
feasible for an embedded system (or maybe not).

I'm interested to know what effect mlockall(2) may have on this. If we have no swap at all, it should be possible to wire all important processes. This may require altering the restriction of only allowing up to a third of RAM to be wired though.


Home | Main Index | Thread Index | Old Index