Tuesday, November 6, 2012

How to find out the Free memory in AIX?



Using the svmon -G command and some calculation we can find out the free memory in aix servers.

#svmon -G

                        size              inuse        free         pin     virtual
memory         2031616      451147     1580469      229041      330471



Free memory = free*4/1024 --> (size in MB)  (1580469 *4/1024)  ---> 6173 MB



## use the below script to find out the current memory status.

----------------------------------------------------------------------------------

#!/usr/bin/ksh
#memory calculator
um=`svmon -G | head -2|tail -1| awk {'print $3'}`
um=`expr $um / 256`
tm=`lsattr -El sys0 -a realmem | awk {'print $2'}`
tm=`expr $tm / 1000`
fm=`expr $tm - $um`
echo "\n\n-----------------------";
echo "System : (`hostname`)";
echo "-----------------------\n\n";
echo "Memory Information\n\n";
echo "total memory = $tm MB"
echo "free memory = $fm MB"
echo "used memory = $um MB"
echo "\n\n-----------------------\n";

Output of the scripts will look like below.

----------------------------------------------
System : (Hostname of the Server)
----------------------------------------------
Memory Information

total memory = 8126 MB
free memory = 6173 MB
used memory = 1953 MB
----------------------------------------------




No comments:

Post a Comment