Currently, the FreeBSD handbook, in its section 2.6.1., states that “As a rule of thumb, the swap partition should be about double the size of physical memory (RAM). Systems with minimal RAM (less for larger-memory configurations) may perform better with more swap. Configuring too little swap can lead to inefficiencies in the VM page scanning code and might create issues later if more memory is added.”
Despite this, I think there are still those who recommend having much less swap based on a longstanding belief that would benefit from being updated.
FreeBSD handles memory very well. It classifies pages according to how frequently the different applications access them, which allows the system to know which ones are the least likely to be needed and can be moved to swap.
Modern software apps, on the other hand, handle memory horribly. Firefox and Chromium, for instance, accumulate memory as if it were infinite, even more so if you use certain extensions.
On other OSs, if you keep doing certain tasks with one of these apps for a period of time, the system runs out of memory and either kills the offending application, crashes, or becomes as sluggish as to be unmanageable.
In FreeBSD this doesn’t happen if you have enough swap. FreeBSD moves there the memory pages that are occupied but, in reality, not being accessed, and the system keeps running perfectly, or, at least, well enough as to keep being manageable.
According to my experience, following the handbook’s rule of thumb practically guarantees that you will never run out of memory due to any memory-hoarder application.
Despite this, I think there are still those who recommend having much less swap based on a longstanding belief that would benefit from being updated.
FreeBSD handles memory very well. It classifies pages according to how frequently the different applications access them, which allows the system to know which ones are the least likely to be needed and can be moved to swap.
Modern software apps, on the other hand, handle memory horribly. Firefox and Chromium, for instance, accumulate memory as if it were infinite, even more so if you use certain extensions.
On other OSs, if you keep doing certain tasks with one of these apps for a period of time, the system runs out of memory and either kills the offending application, crashes, or becomes as sluggish as to be unmanageable.
In FreeBSD this doesn’t happen if you have enough swap. FreeBSD moves there the memory pages that are occupied but, in reality, not being accessed, and the system keeps running perfectly, or, at least, well enough as to keep being manageable.
According to my experience, following the handbook’s rule of thumb practically guarantees that you will never run out of memory due to any memory-hoarder application.