Description:
How is the Memory calculation on AIX by caiUxsA2 done?
Solution:
CaiUxsA2 uses the "fre" value which is displayed in the "vmstat 2 5" output to determine the utilisation of memory.
Considering the below values for example -
"lsattr -El sys0" output shows realmem value as 4194304.
"vmstat 2 5" output
kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------- r b avm fre re pi po fr sr cy in sy cs us sy id wa 1 1 579869 158442 0 0 0 0 0 0 389 3395 341 1 2 97 0 0 0 579880 158431 0 0 0 0 0 0 367 5229 290 0 1 99 0 0 0 579880 158431 0 0 0 0 0 0 367 9461 414 5 7 88 0 0 0 579880 158431 0 0 0 0 0 0 471 5091 313 0 5 89 6 0 0 579880 158431 0 0 0 0 0 0 386 5025 282 0 2 97 2
IMPORTANT - 'fre' is number of page of FREE REAL memory. You have to consider that for AIX the page is a page is 4096 bytes. Once again, in the calculation you have to use the 'fre' and not the 'avm' value.
caiUxsA2 calculates as following:
used real memory = Total amount of real memory - ( ( fre * 4096 ) / 1024)
e.g. 4194304 - ((158442 * 4096) / 1024) = 3560536
You may also verify the below values in configset:
uxsA2StatusMemUtilTotal is total amount of real memory in KB
uxsA2StatusMemUtilValue is Used real memory in KB
From mkconfig output -
uxsA2StatusMemUtilTotal 4194304
uxsA2StatusMemUtilValue 3609756
There will be some discrepancy as per the agent polls at certain intervals, which means we cannot always get the same vmstat output that the agent gets. That is the reason there is a slight difference in the mkconfig output uxsA2StatusMemUtilValue (3609756) and used real memory (3560536).