Section 6.1. Tools for Memory Analysis


6.1. Tools for Memory Analysis

Different tools are used for different kinds of memory analyses. Following is a prioritized list of tools for analyzing the various types of problems:

  • Quick memory health check. First measure the amount of free memory with the vmstat command. Then examine the sr column of the vmstat output to check whether the system is scanning. If the system is short of memory, you can obtain high-level usage details with the MDB ::memstat-d command.

  • Paging activity. If the system is scanning, use the -p option of vmstat to see the types of paging. You would typically expect to see file-related paging as a result of normal file system I/O. Significant paging in of executables or paging in and paging out of anonymous memory suggests that some performance is being lost.

  • Attribution. Using DTrace examples like those in this chapter, show which processes or files are causing paging activity.

  • Time-based analysis. Estimate the impact of paging on system performance by drilling down with the prstat command and then further with DTrace. The prstat command estimates the amount of time stalled in data-fault waits (typically, anonymous memory/heap page-ins). The DTrace scripts shown in this chapter can measure the exact amount of time spent waiting for paging activity.

  • Process memory usage. Use the pmap command to inspect a process's memory usage, including the amount of physical memory used and an approximation of the amount shared with other processes.

  • MMU/page size performance issues. Behind the scenes as a secondary issue is the potential performance impact of TLB (Translation Lookaside Buffer) overflows; these can often be optimized through the use of large MMU pages. The trapstat utility is ideal for quantifying these issues. We cover more on this advanced topic in the next chapter.

Table 6.1 summarizes and cross-references the tools covered in this chapter.

Table 6.1. Tools for Memory Analysis

Tool

Description

Reference

DTrace

For drill-down on sources of paging and time-based analysis of performance impact.

6.11

kstat

For access to raw VM performance statistics with command line, C, or Perl to facilitate performance-monitoring scripts.

6.4, 6.13, 6.14

MDB

For observing major categories of memory allocation.

6.4

pmap

For inspection of per-process memory use and facilitation of capacity planning.

6.8

prstat

For estimating potential performance impact by using microstates.

6.6.1

TRapstat

For investigating MMU-related performance impacts.

6.17

vmstat

For determining free memory, scanning and paging rates and types.

6.2, 6.4.2





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