In the distant past there were two “common knowledge” approaches. One was “as much as RAM”, the other “2× RAM size”. One comes from Microsoft Windows; the source of the other is more obscure, but appears to be somewhat related to enterprise usage of Linux. Both are ancient, devised when 4GiB RAM was nerds’ wet dream, and the Windows one is specifically bound to “swap is an emergency RAM” approach.
that rule
with k = { 0.0, 0.1, 0.2, ... 1.0, 1.1, 1.2, ... 2.0, 2.1, .... n } swap.size = k x ram.sizewas/is an
empiric approach based on
statistical analysis.
my PPC-7550 cannot address more than 2GB of ram, the kernel is 32bit and cannot allocate more than 512Mbyte of stack per process.
At the moment the PSU is dead and i'm still trying to figure out how to fix it, during its golden ages it usually spent its time at compiling stuff, from the development of custom programs, to compiling "stage{1,2,3,4}" for Catalyst, so { cpp, cc1, ld, make, perl, python, lua, ... } have always been
the most used processes, and rarely
a single process in that list needs more than 200Mbyte
of ram, as well as rarely I run more than two big Catalyst-
processes in parallel, as well as rarely I need to compile C++ stuff.
Mozilla and Netscape were nice to be built in the early 2000s, once configured, and gcc from v2.96 to 4.1.2 have always been kind in terms of the required ram.
However, when years ago Firefox was written entirely in C++ (now it's an hybrid mess, impossible to be cross-compiled) , I remember there was very high swap pressure with more than 800 Mbytes consumed by gcc.4.5, that means 2.8Gbyte requires on a machine that physically address 2GB.
I remember a couple of "out of ram" crashes because I hadn't allocated any swap, thinking that 2GByte of ram was enough for everything, even because in 2005, 2Gbyte was a rarity to have on a computer since very expensive.
RAM: 2GB
Swap: 0 <------------ k= 0.0, you assume the ram is already enough
So then my choice was 2GB of disk space instead of 1GB for the swap, as
"coverage" safe (k = 1.0), just in case.
RAM: 2GB
Swap: 2GB <------------ k= 1.0
Probably k = 2.0 had/has a similar "coverage" choice behind its shoulders
