The recommendation (swap == 2 x RAM) was more common in the nineties when RAM was much more expensive. It was a reflection that the resident set size (RSS) of a process is often a fraction of its Virtual Memory footprint (often an order of magnitude smaller), so a process could run effectively even with most of its data swapped out to disk.<p>There was a fair amount of interesting engineering to make swap effective.. For example, for the code (text) segment, which was read-only, you&#x27;d use the file itself (e.g. a.out) as the swap for the text (code) portion, and if you&#x27;d try to `rm a.out` while it was running, you&#x27;d get a &quot;text file busy error&quot;.