The SunOS 5.7 system software uses some disk slices for temporary storage rather than for file systems. These slices are called swap slices. Swap slices are used as virtual memory storage areas when the system does not have enough physical memory to handle current processes.
The SunOS 5.7 virtual memory system maps physical copies of files on disk to virtual addresses in memory. Physical memory pages which contain the data for these mappings can be backed by regular files in the file system, or by swap space. If the memory is backed by swap space it is referred to as anonymous memory because the user doesn't know the names of the files backing the memory.
SunOS 4.0/4.1 anonymous memory pages are mapped using randomly assigned names from the system's swap space pool. These memory pages are used for:
Private copies of data created during copy-on-write operations
Process and stack segments
The TMPFS file system storage resources
The limitations of the SunOS 4.0/4.1 anonymous memory implementation are:
Physical storage (disk-backed swap) must always be reserved for anonymous memory mappings even if the application doesn't use it.
For example, applications with large data segments must be configured with lots of swap space even if the pages are not written out to physical storage.
The formula used to associate an anonymous memory page with physical storage is limited and inflexible because the backing store is chosen at random and can never be changed.
The SunOS 5.7 software environment introduces the concept of virtual swap space, a layer between anonymous memory pages and the physical storage (or disk-backed swap space) that actually back these pages. A system's virtual swap space is equal to the sum of all its physical (disk-backed) swap space plus a portion of the currently available physical memory.
Virtual swap space has these advantages:
The need for large amounts of physical swap space is reduced because virtual swap space does not necessarily correspond to physical (disk) storage.
A pseudo file system called SWAPFS provides addresses for anonymous memory pages. Because SWAPFS controls the allocation of memory pages, it has greater flexibility in deciding what happens to a page. For example, it may change the page's requirements for disk-backed swap storage.