HowTo: Check Swap Usage In Solaris Unix

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements None
Est. reading time N/A
How do I check swap (page) usage under Sun / Oracle Solaris Unix operating systems using command line options? How do I see virtual memory statistics including used and total swap space?

Solaris Unix supports various command to get the information about swap space. You need to login as root and type the following commands:

# swap -s
# swap -l

You can also use the top and vmstat commands:
# top
# vmstat
# vmstat -p

You need to see page field which report information about page faults and paging activity. The information on each of the following activities is given in units per second:

re – page reclaims β€” but see the -S option for how this field is modified.
mf – minor faults β€” but see the -S option for how this field is modified.
pi – kilobytes paged in
po – kilobytes paged out
fr – kilobytes freed
de – anticipated short-term memory shortfall (Kbytes)
sr – pages scanned by clock algorithm
When executed in a zone and if the pools facility is active, all of the above (except for β€œde”) only report activity on the processors in the processor set of the zone’s pool.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • santosh Jun 2, 2016 @ 13:37

    I have a question regarding solaris zfs , I dont know whether this is the right forum or not .

    Command : zfs list

    output :
    bash-3.00# zfs list rpool/swap
    rpool/swap 1.59G 106G 92.6M –

    command : swap -l
    swapfile dev swaplo blocks free
    /dev/zvol/dsk/rpool/swap 181,2 8 3145720 3119248

    The value of usage of swap in both the cases is different, In zfs list command the value of swap usage is 1.59 g
    But the value of swap used in through swap -l is around 0.012g ((3145720 – 3119248)/(2*1024*1024))

    why both the outputs are different. As i am new to to this solaris can anybody help me out.


Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum