Re: kernel: warning: total configured swap (493567 pages) exceeds maximum recommended amount
Date: Tue, 11 Nov 2025 17:22:45 UTC
On Nov 11, 2025, at 07:34, Dag-Erling Smørgrav <des@FreeBSD.org> wrote:
> void <void@f-m.fm> writes:
>> On a newly installed
>> FreeBSD-16.0-CURRENT-arm-armv7-GENERICSD-20251103-088ced14a69b-281661.img
>>
>> unmodified settings 32GB mmcsd.
>>
>> fstab entry for swap is:
>>
>> /dev/label/growfs_swap none swap sw 0 0
>>
>> swap in top shows:
>>
>> Swap: 1928M Total, 1928M Free
>>
>> # sysctl kern.maxswzone
>> kern.maxswzone: 0
>>
>> ??? how to fix/should I fix?
>
> The amount of swap space you can use is limited by the size of the data
> structures used to manage it. These structures must be preallocated
> (otherwise we might deadlock trying to allocate more while already low
> on memory) and cannot be swapped out (we wouldn't know how to swap them
> back in) so getting the size right on a memory-constrained system can be
> quite tricky. If you configure more swap than half the amount that can
> be managed, you get the above warning, which you can safely ignore
> unless you either need a lot of swap or have very little physical memory
> and don't need much swap.
>
> See also <https://reviews.freebsd.org/D53688>.
>
man 8 loader_simp reports:
kern.maxswzone
. . .
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.
. . .
===
Mark Millard
marklmi at yahoo.com