Physical RAM
Fast semiconductor memory. Directly used by running processes. Limited but very fast.
Solaris · Swap
Solaris · Lesson 21
Swap is part of Solaris virtual memory. Understanding the difference between physical RAM and swap, and knowing how to create and manage ZFS-based swap devices, is critical for real-world administration.
Solaris uses virtual memory, which combines physical RAM and swap space. Swap is disk space used to store memory pages when RAM is not enough.
Fast semiconductor memory. Directly used by running processes. Limited but very fast.
Disk-based extension of memory. Much slower than RAM but allows more processes to run than physical RAM alone.
When RAM pressure increases, Solaris can move less-used pages to swap (paging out). When needed again, pages are read back into RAM (paging in). Excessive swap I/O (thrashing) usually means the system needs more RAM or fewer workloads.
On modern Solaris systems, swap is often provided by ZFS volumes (zvols) inside the root pool rpool, exposed as block devices under /dev/zvol/dsk.
This gives flexibility: you can create, resize or remove swap volumes using zfs commands, and then activate or deactivate them dynamically using swap commands.
Use these flows in your lab Solaris system. Be careful on production systems, especially if memory is already tight.
top (or prstat) gives a quick view of RAM, swap and process usage.
swap -l shows swap devices; swap -s shows virtual memory summary (allocated, reserved, available).
In Solaris 11, default swap is often a ZFS volume in rpool. volsize is the logical volume size.
Create a ZFS volume (block device) that we can later add as swap with swap -a.
Use the ZFS volume device path from /dev/zvol/dsk. swap -a makes it active immediately.
swap -d removes it from active swap. ZFS volume still exists and can be reused or destroyed later.
swap -s and top before disabling a swap device./etc/vfstab (do this only when you fully understand your environment policies).In the next topics, this understanding will help when tuning performance, planning memory, and troubleshooting slow systems.