"swap" partition leads to instability?

Paul Kraus paul at kraus-haus.org
Wed May 29 20:13:42 UTC 2013

On May 29, 2013, at 3:52 PM, jb <jb.1234abcd at gmail.com> wrote:

> Yes, there is some confusion about the diff, if any, between paging and 
> swapping.
> Paging - copying or moving pages between physical memory (RAM) and secondary
>  storage (e.g. hard disk), in both directions.
> Swapping - nowdays is synonymous with "paging".

> You say that FB supports both, Linux supports paging only.
> Well, Linux utilizes swap space as part of virtual memory.
> So, can you elaborate more on that - what is the essence of the diff, why
> should I avoid the term "swapping" when referring to Linux, assuming VMM
> systems on both ?

	When I started working professionally with Unix systems in 1995, I was taught that paging was the process of copying least used "pages" of RAM onto disk so that the RAM could be freed if the system needed more RAM. Swapping was the process of moving an entire program from RAM to disk in order to free up RAM.

	In other words, a process can be "swapped out" and placed on disk until it comes up to run again, at which point it can be "swapped in" and executed.

	I think that much of the confusion comes from the use of the SWAP device by the PAGING system. When the concept of paging came about, it just used the already existing SWAP space to store it's "paged out" pages of memory.

	On the systems I worked on at the time (SunOS / Solaris), paging was a sign of pressure on the physical memory (RAM) of a system, swapping was a sign of _severe_ physical memory pressure. This was a time when we configured 2 to 4 times the amount of physical RAM as SWAP space. RAM was very expensive and hard drives just expensive :-) It was common on a "normally" operating system to see the page scanner* running up to 100 times per second. A scan rate of over 100 was considered a sign of pressure on RAM that needed to be addressed, any SWAPing was considered a sign that the system needed more physical RAM.

	Today RAM is so cheap that _any_ paging is often considered bad and an indication that more Ram should be added.

*Solaris Page Scanner: This is a kernel level process that wakes up, examines the amount of free RAM, and takes action based on that value. The thresholds are all dynamic and based on the amount of RAM in the system. Above a high water mark the scanner does nothing. As the amount of free RAM drops, various pages of RAM are copied to SWAP space and the RAM freed. Eventually, if the amount of free Ram falls low enough, even parts of the kernel will be paged out. This is very bad and can lead to a system "thrashing" where it spends the vast majority of it's time just paging in and out and not actually getting anything done.

Paul Kraus
Deputy Technical Director, LoneStarCon 3
Sound Coordinator, Schenectady Light Opera Company

More information about the freebsd-questions mailing list