On 07/09/2025 05:11, Mark Millard wrote:
On Sep 6, 2025, at 19:10, Graham Perrin <[email protected]> wrote:
…
…
So you are saying at this point that the combination for
RAM+SWAP inside the VM is:
1 GiByte RAM in VM and 8 GiByte SWAP in that VM as well?
Yes.
If yes, that should have produced a warning about potential
mistuning …
True.
I spent years ignoring the kern.maxswzone warning, partly because I
never noticed any adverse effect from ignorance. When set to 16 G on
hardware with 32 G RAM, the amount of swap used was sometimes close to
the amount available.
Today I found the variable in loader_simp(8) under
<https://man.freebsd.org/cgi/man.cgi?query=loader_simp&sektion=8&manpath=freebsd-current#BUILTIN%09COMMANDS>,
… If no value is provided, the system allocates enough memory to
handle an amount of swap that corresponds to eight times the amount of
physical memory present in the system.
Note that swap metadata can be fragmented, which means that the system
can run out of space before it reaches the theoretical limit.
Therefore, care should be taken to not configure more swap than
approximately half of the theoretical maximum.
Running out of space for swap metadata can leave the system in an
unrecoverable state. Therefore, you should only change this parameter
if you need to greatly extend the KVM reservation for other resources
such as …
Without me attempting to perform any calculation: I reckon, I always did
well (no unexpected run-out) by _not_ providing a value.