How does the installer calculate what size of swap partition to create? Presumably it's based on installed RAM size, but does that depend on how much RAM?
Actually there is no
What happens is that the
A recipe file can look like this:
The algorithm to calculate the sizes:
For more see:
This is going to be rather technical but was fun to find out so here goes...
setup - tells dphys-swapfile to compute the optimal swap file size and (re-)generate an fitting swap file. Default it 2 times RAM size. This can be called at boot time, so the file allways stays the right size for current RAM, or run by hand whenever RAM size has changed.
size we want to force it to be, default (empty) gives 2*RAM CONF_SWAPSIZE=
and a setting for a
As you can see the way they calculate it in this package depends on the size of
So the default for this system would be 1065349120 / 1048576 = 1015+1 = 1016 * 2 = 2032 MBytes.