On fashionable Unix-like techniques reminiscent of FreeBSD, “swapping” refers back to the exercise of paging out the contents of reminiscence to a disk after which paging it again in on demand. The page-out exercise happens in response to a scarcity of free reminiscence within the system: the kernel tries to establish pages of reminiscence that most likely is not going to be accessed within the close to future, and copies their contents to a disk for safekeeping till they’re wanted once more. When an utility makes an attempt to entry reminiscence that has been swapped out, it blocks whereas the kernel fetches that saved reminiscence from the swap disk, after which resumes execution as if nothing had occurred.
In 2021, low cost SSDs have develop into commonplace and have efficiency traits significantly better suited to swapping, so it appears worthwhile to revisit how swapping works in FreeBSD, and attempt to present some perception into often raised points.
Some gentle studying for the weekend.