6.12. Obtaining Memory KstatsTable 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.
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 |