Académique Documents
Professionnel Documents
Culture Documents
A systems virtual memory is a combination of RAM and disk space. Portions of the virtual
memory are reserved as swap space.
Swap space can be dened as a temporary storage location that is used when the systems
memory requirements exceed the size of available RAM.
# swap -l ==> to list the details of the systems physical swap areas
Note There can be a discrepancy in available and free swap space size between the swap -s and
swap -l outputs. The swap -s output does not take into account pre-allocated swap space that has
not yet been used by a process.
# vi /etc/vfstab
/dev/dsk/c1d0s1 - - swap - no -
# swap -a /dev/dsk/c1d0s1
Note When the system is subsequently rebooted, the new swap slice /dev/dsk/c1t3d0s1 is
automatically included as part of the swap space as a result of adding the entry to the /etc/vfstab
le.
Adding Swap Files:
1. Identify a le system that has adequate space to create an additional swap le, preferably on
another drive.
# mkdir -p /usr/local/swap
# swap -a /usr/local/swap/swapfile
# swap -l
# swap -s
7. To use a swap le when the system is subsequently rebooted, add an entry for the swap le in
the /etc/vfstab le.
# vi /etc/vfstab
/usr/local/swap/swapfile - - swap - no -
# swap -d /dev/dsk/c1d0s1
2. To prevent the swap slice from being congured as part of the swap conguration during a
reboot or change of run level, edit the /etc/vfstab le, and remove the swap slice entry from the
le.
# swap -d /usr/local/swap/swapfile
# rm /usr/local/swap/swapfile
3. To prevent the swap le from being congured as part of the swap conguration during a
reboot or change of run level, edit the /etc/vfstab le, and remove the swap le entry.
Note The output of the df -h command shows the space used by the swap le until it is
removed.