This article hasn't been updated for over 5 years. The information below may be obsolete.

Understanding 'swap' output

In the good old days, swap meant only the "disk portion" of virtual memory. With recent additions and updates to the Solaris OS swap combines "traditional swap" & "unused RAM". In reality swap has now become the virtual memory.

Getting swap information is simple, but have you really looked at what the output is saying?

Using swap -s produces a summary of the vitual memory usage.

For example:

root@solaris# swap -s
total: 1124728k bytes allocated + 558824k reserved = 1683552k used, 15399632k available

In the above output, notice that all the values are in 1k units (1024 bytes).

Breaking down the output, we see:

  • allocated — Amount of memory pages effectively used by processes written to virtual memory. From the about example:1124728k = 1.072 GB of virtual memory already in use.
  • reserved — Amount of virtual memory not yet written to. From the above example:558824k = 0.532 GB of virtual memory is yet to be used.
  • available — Virtual memory that can be provided to processes. For the about example:15399632k = 14.686 GB of virtual memory is available.