JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Administration: Devices and File Systems     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Managing Removable Media (Tasks)

2.  Writing CDs and DVDs (Tasks)

3.  Managing Devices (Tasks)

4.  Dynamically Configuring Devices (Tasks)

5.  Managing USB Devices (Tasks)

6.  Using InfiniBand Devices (Overview/Tasks)

7.  Managing Disks (Overview)

8.  Managing Disk Use (Tasks)

9.  Administering Disks (Tasks)

10.  Setting Up Disks (Tasks)

11.  Configuring Storage Devices With COMSTAR (Tasks)

12.  Configuring and Managing the Oracle Solaris Internet Storage Name Service (iSNS)

13.  The format Utility (Reference)

14.  Managing File Systems (Overview)

15.  Creating and Mounting File Systems (Tasks)

16.  Configuring Additional Swap Space (Tasks)

About Swap Space

Swap Space and Virtual Memory

Swap Space and the TMPFS File System

Swap Space and Dump Device Configuration

Swap Space and Dynamic Reconfiguration

Configuring Swap Space in a SAN Environment

How Do I Know If I Need More Swap Space?

Swap-Related Error Messages

TMPFS-Related Error Messages

How Swap Space Is Allocated

Swap Areas and the /etc/vfstab File

Planning for Swap Space

Allocating Swap Space for ZFS-Based Systems

Monitoring Swap Resources

Adding or Changing Swap Space in an Oracle Solaris ZFS Root Environment

How to Add Swap Space in an Oracle Solaris ZFS Root Environment

17.  Copying Files and File Systems (Tasks)

18.  Managing Tape Drives (Tasks)

Index

Monitoring Swap Resources

The /usr/sbin/swap command is used to manage swap areas. Two options, -l and -s, display information about swap resources.

Use the swap -l command to identify a system's swap areas. Activated swap devices or files are listed under the swapfile column. For example:

# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0t0d0s1   136,1      16 1638608 1600528

On a system with a ZFS root file system, the swap -l command identifies similar output except that it identifies the ZFS volume path name. For example:

# swap -l
swapfile                  dev  swaplo blocks   free
/dev/zvol/dsk/rpool/swap 256,1      16 1058800 1058800

Use the swap -s command to monitor swap resources.

# swap -s
total: 57416k bytes allocated + 10480k reserved = 67896k used, 
833128k available

The used value plus the available value equals the total swap space on the system, which includes a portion of physical memory and swap devices (or files).

You can use the amount of available and used swap space (in the swap -s output) as a way to monitor swap space usage over time. If a system's performance is good, use swap -s to determine how much swap space is available. When the performance of a system slows down, check the amount of available swap space to determine if it has decreased. Then you can identify what changes to the system might have caused swap space usage to increase.

When using this command, keep in mind that the amount of physical memory available for swap usage changes dynamically as the kernel and user processes lock down and release physical memory.


Note - The swap -l command displays swap space in 512-byte blocks. The swap -s command displays swap space in 1024-byte blocks. If you add up the blocks from swap -l and convert them to KB, the result is less than used + available (in the swap -s output). The reason is that swap -l does not include physical memory in its calculation of swap space.


The output from the swap -s command is summarized in the following table.

Table 16-2 Output of the swap -s Command

Keyword
Description
bytes allocated
The total amount of swap space in 1024-byte blocks that is currently allocated as backing store (disk-backed swap space).
reserved
The total amount of swap space in 1024-byte blocks that is not currently allocated, but claimed by memory for possible future use.
used
The total amount of swap space in 1024-byte blocks that is either allocated or reserved.
available
The total amount of swap space in 1024-byte blocks that is currently available for future reservation and allocation.