spurious out of swap kills

Mark Millard marklmi at yahoo.com
Sat Sep 14 06:14:59 UTC 2019

Don Lewis truckman at FreeBSD.org wrote on
Thu Sep 12 23:00:19 UTC 2019 :

. . .
> Nevertheless, I see these errors,
> with rustc being the usual victim:
> Sep 11 23:21:43 zipper kernel: pid 16581 (rustc), jid 43, uid 65534, was killed: out of swap space
> Sep 12 02:48:23 zipper kernel: pid 1209 (rustc), jid 62, uid 65534, was killed: out of swap space
. . .

Unfortunately, the wording of this type of message is a misnomer for
what drives the kills: it is actually driven by being unable to gain
more free memory but FreeBSD will not swap-out processes that stay
runnable (or are running), only ones that are waiting. Even a single
process that stays runnable and keeps lots of RAM in the active
category can lead to kills when swap is unused or little used. So the
kill-behavior is very workload dependent.

Real "out of swap" conditions tend to also have messages
similar to:

Aug  5 17:54:01 sentinel kernel: swap_pager_getswapspace(32): failed

If you are not seeing such messages, then it is likely that
the mount of swap space still free is not the actual thing
driving the kills.

Are you seeing "swap_pager_getswapspace(32): failed" messages?

(It used to be that the system simply leaves the dirty pages in
memory when a swap_pager_getswapspace failed message is produced.
Of itself, it did not cause a kill. I do not know about now.)

Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

More information about the freebsd-current mailing list