LPAR Virtual memory usage

In ITM, a statistic is reported and alerted on called “Virtual Storage” which is a little misleading to us UNIX admins, because we could take this to mean paging or swap space.

In AIX, it does not mean this though, it means virtual memory, and is not found by looking at lsps or topas/NMON paging statistics.

To work it out you need to read this or, try this script below…

mem_size=`svmon | grep memory | awk '{print $2}'`
page_size=`svmon | grep pg | grep -v inuse | awk '{print $3}'`
 
(( total_virt = mem_size + page_size ))
(( total_virt_kb = total_virt * 4 ))
 
vmstat_sample=`vmstat 1 2 | tail -1`
vmstat_avm=`echo $vmstat_sample | awk '{print $3}'`
vmstat_fre=`echo $vmstat_sample | awk '{print $4}'`
 
(( free_mem = vmstat_fre * 4 ))
 
(( avm_mem = vmstat_avm * 4 ))
 
vm_used=$(echo "scale=2;${avm_mem}/${total_virt_kb}"|bc -l)
 
vm_perc_used=$(echo "scale=2;${vm_used}*100"|bc -l)
 
(( vm_avail = 100 - vm_perc_used ))
 
echo "Virtual Memory Used (%) = $vm_perc_used"
echo "Virtual Memory Free (%) = $vm_avail"

The figures from this should match what ITM is telling you.

Published
Categorized as AIX, FAQs

By 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.

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