DOCUMENT ID:  1230-02

SYNOPSIS:     Three Virtual Memory Performance Monitors

OS RELEASE:   2.x

PRODUCT:      Solaris 

KEYWORDS:     vm virtual memory performance monitors


DESCRIPTION:

Software Virtual Memory - Performance Monitors 

*       vmstat
        
*       sar

*       proctool

These three performance monitors are used to analyze Virtual Memory
performance characteristics.  Both sar and vmstat heavily rely on data
that is contained in the following four kernel structures:

*       vminfo
        
*       sysinfo

*       cpu_vminfo

*       cpu_sysinfo

These structures are in /usr/include/sys/sysinfo.h


SOLUTION:

Software VM - vmstat

vmstat supplies the following data related to software virtual memory:

*       re - number of page reclaims
                   
cpu_vminfo.pgrec - incremented whenever a valid page is reclaimed from
the freelist.  Also incremented when pvn_write_done tries to free a page
and notices that the page has been referenced by another thread. 

*       mf - number of "minor" faults (cpu_info.hat_fault + 
        cpu_vminfo.as_fault)

cpu_vminfo.hat_fault - incremented whenever a fault can be satisfied by
loading the software copy of a pte into the MMU. 
                
cpu_vminfo.as_fault - incremented in as_fault() for each fault that is
the result of an invalid translation. 

*       pi - kilobytes of data that has been paged. 

cpu_vminfo.pgpgin - incremented in pageio_setup() for each page that is
needed. 

*       swap - amount of unreserved swap space 

vminfo.swap_avail - this value is the result of subtracting the total
amount of reserved swap space from the maximum swap space on the system. 

*       free - amount of free physical memory

vminfo.freemem - updated in the clock() routine at a one-second
intervals. 

Software VM - sar

The -r and -p options for sar(1) provide data relevant to the software
VM subsystem. 

*       atch/s - updated only for valid pages reclaimed from the
        freelist.

cpu_vminfo.pgfrec - incremented each time a page fault results in the
page being found on the page freelist.  This value is incremented in
page_reclaim(). 

*       pgin/s - page-in requests. Several pages may make up one
        request.

cpu_vminfo.pgin - incremented in pageio_setup() for each request of one
or more pages. 

*       ppgin/s - number of pages paged in per second.

        cpu_vminfo.pgpgin - same as vmstat() pi field.

*      pflt/s - number of faults that occurred because of
       protection errors. (cpu_vminfo.prot_fault + 
       cpu_vminfo.cow_fault).  

cpu_vminfo.prot_fault - incremented in as_fault() each time a fault
occurs as a result of a protection error. 

cpu_vminfo.cow_fault - incremented in anon_private() each time a
reference to a object or shared anon page is converted to private page. 

*       vflt/s - address translation faults per second.
        (cpu_vminfo.hat_fault + cpu_vminfo.as_fault)

cpu_info.as_fault and cpu_vminfo.hat_fault - equivalent of mf field in
vmstat(). 


*       slock/s - incremented when a fault occurs due to a 
        lock request

cpu_vminfo.softlock - incremented in as_fault() each time a fault occurs
as a result of a lock request. 

*       freemem - prints current amount of free physical memory
        in 512-byte blocks.

vminfo.freemem - same as vmstat() free field.

*       freeswap - prints current amount of unallocated swap
        space.

vminfo.swap_free - set in the clock() routine once per second.  This
value includes unallocated, unreserved swap space as well as swap space
that has been reserved but not allocated. 


Software VM - proctool

proctool is a window-based tool that can be used to:

*       View current system performance statistics

*       Analyze individual process resource usage
        
*       Graphically record the paging activity on the
        system.

*       Monitor levels of various resources on the system

*       Modify/query a process's scheduling configuration.

proctool is not part of the Solaris 2.x release.  This tool is not
supported by Sun. 


DATE APPROVED: 11/25/94