Section 6.5. Relieving Memory Pressure


6.5. Relieving Memory Pressure

When available physical memory becomes exhausted, Solaris uses various mechanisms to relieve memory pressure: the cyclic page cache, the page scanner, and the original swapper. A summary is depicted in Figure 6.2.

Figure 6.2. Relieving Memory Pressure


The swapper swaps out entire threads, seriously degrading the performance of swapped-out applications. The page scanner selects pages, and is characterized by the scan rate (sr) from vmstat. Both use some form of the Not Recently Used algorithm.

The swapper and the page scanner are only used when appropriate. Since Solaris 8, the cyclic page cache, which maintains lists for a Least Recently Used selection, is preferred.

For more details on these mechanisms, see Chapter 10 in Solaris Internals. This section focuses on the tools used to observe performance, and Figure 6.2 is an appropriate summary for thinking in terms of tools.

To identify where on Figure 6.2 your system is, use the following tools.

  • free list. The size of the free list can be examined with ::memstat from mdb-k, discussed in Section 6.4.3. A large free column in vmstat includes both free list and cache list.

  • cache list. The size of the cache list can also be examined with ::memstat.

  • page scanner. When the page scanner is active, the scan rate (sr) field in vmstat is non-zero. As the situation worsens, anonymous page-outs will occur and can be observed from vmstat -p and iostat -xnPz for the swap partition.

  • swapper. For modern Solaris, it is rare that the swapper is needed. If it is used, the kthr:w field from vmstat becomes non-zero, to indicate swapped-out threads. This information is also available from sar -q. vmstat -S can also show swap-ins and swap-outs, as can sar -w.

  • hard swapping. Try typing echo hardswap/D | mdb -k, to print a counter that is incremented because of hard swapping. If you are unable to type it in because the system is woefully slow, then you can guess that it is hard swapping anyway. A system that is hard swapping is barely usable. All other alarm bells should also have been triggered by this point (scan rate, heavy anonymous page-outs, swapped-out threads).




Solaris Performance and Tools(c) Dtrace and Mdb Techniques for Solaris 10 and Opensolaris
Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris
ISBN: 0131568191
EAN: 2147483647
Year: 2007
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net