How is Memory information calculated by cdm probe for HP-UX based systems

Document ID : KB000012049
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

How is Memory information calculated by cdm probe for HP-UX based systems

Answer:

The memory usage is found using the system call pstat_getdynamic(). 

The swap usage is found using the system call pstat_getswap(). 

Paging data is found using the system call pstat_getvminfo(). 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. 

 

  •  Please find below API and the calculation formula used in HP-UX. 

 

API's for the calculation. 

1.pstat_getdynamic 

2.pstat_getswap 

3.pstat_getstatic 

 

Formulas: 

 

  • For the calculation of swap. 

"pstat_getswap" API is used for swap information in the probe. 

We use "pss_nblksenabled" parameter for calculation block device and "pss_swapchunk" for filesystem device. We are using a structure variable “si” which is passed in “pstat_getswap” then further for the calculation of swap total, calculated as follows: 

if (si.pss_flags & SW_BLOCK) 

swap_total += (si.pss_nblksenabled / 1024); 

swap_free += pagetom(si.pss_nfpgs); /* pages, not blocks! */ 

else if (si.pss_flags & SW_FS) 

swap_total += (si.pss_limit * si.pss_swapchunk / 1024); 

swap_free += pagetom(si.pss_nfpgs); 

 

  • We are using "pstat_getstatic" API for calculation of Physical Memory. 

 

  • Physical Used= Physical Mem - Memory free(calculated from page)- Cache Buffer 

Total Physical= Physical Mem + Total Swap 

Total Used = Physical Used + Swap Used - Cache Buffer(depends on gMemBufferUsed key) 

 

Additional Information:

CPU, Disk and Memory probe (cdm) Technical Brief

TEC000003028