Wednesday, September 1, 2010

Swap Memory for Solaris

Having an appropriate amount of swap space is important for optimal system performance. Simple commands allow monitoring swap space utilization.


To get a summary of total system swap space, use the swap command:

swap -s

total: 597744k bytes allocated + 99760k reserved = 697504k used, 095216k available

The output of the swap -s command shows the amount of swap space used (697504KB in this example) and available (95216KB), and further breaks down the used swap space into allocated and reserved. Allocated space represents swap space currently in use. Reserved space is in limbo, not available, not in use, but reserved for future use.

To get details on the individual devices or files that constitute the swap space, use:

swap -l

swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 32,1 16 2624560 2624560
/dev/dsk/c0t8d0s1 32,57 16 2624560 2624560

The swapfile column is the device or filename of the swap component. The dev column shows the major and minor device numbers for devices or zeros for a file. Blocks is the total size of the swap component in 512 byte blocks (divide by two for KB) and free shows the number of 512 byte blocks unused.

No comments:

Post a Comment