Is this possible?
Peter Silva
peter at bsqt.homeip.net
Thu Oct 6 00:27:08 UTC 2016
On Wed, Oct 5, 2016 at 4:24 PM, Bob <ubuntu-qygzanxc at listemail.net> wrote:
> ** Reply to message from Peter Silva <peter at bsqt.homeip.net> on Wed, 5 Oct 2016
> 07:46:09 -0400
>
>> "swap is maxed out"
>>
>> uh... if that's true, it doesn't matter how much or what kind of cpu
>> you have, it will crawl and die from time to time. your machine is
>> sitting in wait i/o.
>
> true
>
>
>> When "swap is maxed out" the kernel will kill
>> processes randomly, (OOM Killer) you cannot expect a PC with it's
>> memory (including swap space) entirely full to run correctly.
>
> If this is what Linux does that is a very bad design. I would never have
> thought the system would do that.
>
OK, I said randomly, I meant that loosely, in terms of the user being
unlikely to understand what is being killed or why. An explanation
of the algorithm is here: https://linux-mm.org/OOM_Killer
It isn't bad design, it's completely normal and a logical consequence
of an aggressively modern virtual memory system. Detailed
explanation here:
http://www.linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html
Example, you start up two processes (same executable) they start out the same,
so they share memory, then a process needs to write to a memory page,
so that page cannot be shared anymore, OS needs to allocate a new
page. Nobody malloc'd anything, and it was way faster to start up if
you don't copy everything just because two processes are using them.
copy-on-write...
Example, when you do a malloc, and the value isn't initialized, it may
just succeed (as long as the memory would fit into process and/or
virtual memory limits.) when the process actually writes to it,
ahh... then you need it to really exist, but if you don't actually
have the memory (and/or swap) available... (b)OOM.
People are better off not overloading their systems, and never
encountering OOM, but Linux is actually as smart as possible given a
really poor situation.
More information about the ubuntu-users
mailing list