May I know how to calculate total memory utilization and percent of a Solaris 11.3 machine?
Am I wrong in below calculation? or any other way?
memfree=$(vmstat 1 2 | awk '{print $5}' | tail -1) memtotal=$(vmstat 1 2 | awk '{print $4}' | tail -1) memused=$((memtotal-memfree)) mempercent=$((memused * 100 / memtotal)) OS version is: SunOS 5.11 11.3 sun4v sparc
For reference, the vmstat(8) output of vmstat 1 2 on a freshly installed Solaris 11.4 VM looks like this:
root@solaris:~# vmstat 1 2 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr cd -- -- -- in sy cs us sy id 0 0 0 4672456 2127260 342 1628 0 0 0 0 0 48 0 0 0 566 10129 2466 11 13 76 0 0 0 4753212 830276 5 141 0 0 0 0 0 0 0 0 0 527 1205 469 2 5 93
vmstat 1 2? Add that as reference info to your question please (not in comments).