AIX : ksh : Show free pages in Mb

This is a quick script that is handy when monitoring memory usage
on AIX. Vmstat shows memory in pages, which are 4096-bytes per page; no
overly helpful when trying to determine how much of your physical
memory is being used, so this script converts that field in Mb.


# Quick script to output free memory pages in Mb

echo "Crtl-C to exit"

while :

do

val=vmstat 1 2 | tail -1 | awk ‘{print $4}’

(( val1 = val * 4096 ))

(( val1 = val1 / 1024 ))

(( val1 = val1 / 1024 ))

echo $val1

sleep 2

done

And, yes, I know, there’s probably so quicker way to do the sums, but it works for me!

About troyski

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation