swap config

Lorenzo Salvadore phascolarctos at protonmail.ch
Sun Sep 9 12:40:13 UTC 2018

> My system has 16GB of memory, so I multiplied that by 4 to get 64GB.
> I created a swap partition of 64GB.
> When I boot, I get:
> warning: total configured swap (16777216 pages) exceeds maximum recommended
> amount (986928 pages).
> warning: increase kern.maxswzone or reduce amount of swap.
> I tried adding kern.maxswzone to /boot/loader.conf but it complains no matter
> what value I set.
> What should I do? I'm not actually swapping, since I have so much memory, so
> I could turn swap off and re-create the swap partition.
> Correct?

The swap space you reserve depends of course on what you do with your computer,
however 64GB, whatever your use is and whatever the formula you used to
determine this is, seems huge to me. Keep in mind that

1.  as you say, you already have 16GB of RAM and you are not swapping, hence
    you are waisting 64GB of HD;

2.  swap is slow: if you ever happen to need that much swap space, then you would
    better have a very fast computer to still use it! I.e. a very fast disk access (cpu
    speed is secondary), and I doubt normal computers are able to reach such high speeds.

I would suggest you turn off swap completely, without recreating any swap partition.
In alternative, you could use a zfs filesystem, which would allow you to size
your swap space dynamically as you need it and you could still set maxium and
minimum swap space if you wanted.

Lorenzo Salvadore.

More information about the freebsd-questions mailing list