Exploring swap on FreeBSD

On modern Unix-like systems such as FreeBSD, “swapping” refers to the activity of paging out the contents of memory to a disk and then paging it back in on demand. The page-out activity occurs in response to a lack of free memory in the system: the kernel tries to identify pages of memory that probably will not be accessed in the near future, and copies their contents to a disk for safekeeping until they are needed again. When an application attempts to access memory that has been swapped out, it blocks while the kernel fetches that saved memory from the swap disk, and then resumes execution as if nothing had happened.

[…]

In 2021, cheap SSDs have become commonplace and have performance characteristics much better suited to swapping, so it seems worthwhile to revisit how swapping works in FreeBSD, and try to provide some insight into frequently raised issues.

Some light reading for the weekend.

7 Comments

  1. 2021-01-18 4:03 am
    • 2021-01-18 9:15 am
      • 2021-01-18 6:34 pm
    • 2021-01-18 9:23 pm
      • 2021-01-18 9:40 pm
      • 2021-01-18 11:11 pm
        • 2021-01-19 1:43 am