- Memory usage is found using the system call sysconf(_SC_AVPHYS_PAGES). The result is the number of free pages of physical memory which is multiplied by the page size and subtracted from the physical memory.
- Swap usage is found using the system call swapctl().
- Paging data is found by running either “/usr/bin/vmstat –s” or “/usr/5bin/vmstat –s” (depending on which is installed on the system) and parsing the data it provides. Since the data is cumulative the difference since the last data gathering is used as the basis for calculating paging in KB/s based on the formula paging_kbps = paging_delta * pagesize / interval.