Solved New freebsd-swap space with 400GB but htop shows 66.0G

Hi daemons,

I created a new partition:
Code:
sudo gpart add -t freebsd-swap -i 2 ada 2
sudo swapon /dev/ada2p2

It works great but, the whole partition is of 400G but, htop only shows `66.0G`

Why is that?
 
Thanks for reply. Really not needed but, wanted to know if that can be changed. Can it be? -- I guess no.
 
There are some limits you're going to run into. One of them the max size of a single swap partition, so you're going to need to create multiple 64GB partitions. But then you're also going to run into various paging limits that need to be adjusted too. Can it be changed? Sure. Should you? No, not unless you have a good reason to do so.
 
Hm... I'm just about to install a system with 64 GB RAM. The handbook advises that swap should be "double the size of physical memory" which would mean 128 GB swap. Is this a bad recommendation?
 
Is this a bad recommendation?
No, just very old, it still stems from a time when systems had a few MB of memory. There's some debate about the "optimal" size but I generally don't make my swap bigger than 8GB regardless of how much memory the system has. There are only a few use-cases that would warrant a bigger swap.
 
If you plan to save crashdumps the total space (may be split over multiple devices) should be at least as large as physical memory. Though in practice you will likely have no use for saving crashdumps!
 
Devices marked dump or swap in /etc/fstab are used for storing the crashdump on kernel panic. You can now netdump. Also, the default is minidump (memory in use by the kernel) so... you can get by with less. I have two partitions 64GB each on a machine with 64GB RAM but in 3 years I haven't saved a single crashdump!
 
What about the handbook's warning that configuring a smaller swap size "can lead to inefficiencies in the VM page scanning code"? Has that part of the kernel since then been improved in this regard, or will performance be significantly affected by a smaller swap size?
 
What about the handbook's warning that configuring a smaller swap size "can lead to inefficiencies in the VM page scanning code"?
Also stems from a time when memory was measured in MB.

or will performance be significantly affected by a smaller swap size?
Swap shouldn't be used at all in an ideal situation. If you have enough memory nothing will get swapped out. You configure swap to account for some run away processes that might make the system run out of memory. It buys you some extra time before the out-of-memory killer starts killing processes.
 
Example, when I run poudriere with 64 parallel processes and 8G memory, next morning my computer is rebooted, which is normal because sooner or later you run out of swapspace. It's a question of "dimensioning".
 
Back
Top