Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris

6.12. Obtaining Memory Kstats

Table 6.3 shows the system memory statistics that are available through kstats. These are a superset of the raw statistics used behind the vmstat command. Each statistic can be accessed with the kstat command or accessed programmatically through C or Perl.

Table 6.3. Memory-Related Kstats

Module

Class

Name

Description

unix

pages

system_pages

Systemwide page count summaries

unix

vm

segmap

File system mapping statistics

unix

kmem_cache

segvn_cache

Anonymous and memory mapped file statistics

unix

hat

sfmmu_global_stat

SPARC sun4u MMU statistics

cpu

misc

vm

Systemwide paging statistics

The kstat command shows the metrics available for each named group; invoke the command with the -n option and the kstat name, as in Table 6.3. Metrics that reference quantities in page sizes must also take into account the system's base page size. Below is an example.

$ kstat -n system_pages module: unix instance: 0 name: system_pages class: pages availrmem 343567 crtime 0 desfree 4001 desscan 25 econtig 4278190080 fastscan 256068 freemem 248309 kernelbase 3556769792 lotsfree 8002 minfree 2000 nalloc 11957763 nalloc_calls 9981 nfree 11856636 nfree_calls 6689 nscan 0 pagesfree 248309 pageslocked 168569 pagestotal 512136 physmem 522272 pp_kernel 64102 slowscan 100 snaptime 6573953.83957897 $ pagesize 4096

Категории