The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9 0ktalmagik SUN Solaris 4 02-03-2009 09:37 AM
Free Memory in aix manoj.solaris AIX 11 01-04-2009 03:29 PM
how can i get The total size of the process in virtual memory om GB or MB umen UNIX for Dummies Questions & Answers 1 02-21-2007 07:43 AM
Easy one : command listing total memory beginer HP-UX 4 05-31-2006 08:22 AM
Total Memory/Swap Memory ghe1 Filesystems, Disks and Memory 4 04-01-2002 10:33 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-15-2008
vimalbhan vimalbhan is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 2
Smile How to check free/total Memory in AIX

Friends , i have a question how to check the total memomry and free memory in AIX, We have vmstat ,svmon and topas commands.Which command among the will give the true figure.
  #2 (permalink)  
Old 01-16-2008
isobhi isobhi is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 2
Smile free/total memory

check svmon manual in AIX

svmon -G
size inuse free pin virtual
memory 786432 99980 686452 61545 86822
The memory size of the system is 786432 frames (786432*4*1024
bytes, or 208 GB). This size is split into the inuse frames (99980
frames) and the free frames (686452 frames).
  #3 (permalink)  
Old 01-16-2008
chandan_m chandan_m is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 4
I have written this tiny script to accurately do the stuff. u can use this.

.

Save the below code between the Marker Lines, into a file called WHAT_EVER_YOU_WANT.sh and give it executable permissions by executing chmod as follows:

chmod +x ./WHAT_EVER_YOU_WANT.sh

And execute it, it will give you all the details like current RAM in MB's ( easy to understand ) and also who are connected remotely and form where. you can tailor it to use only the memory retrieval part also.




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

echo "\n\n-----------------------";
echo " Users Login information \n";

for ENTRY in `finger | cut -d " " -f1 | grep -v Login | uniq`
do
echo "`finger -l $ENTRY | head -1 | cut -d \" \" -f14` --->  `finger -l $ENTRY | awk '{ print $2 }' | tail -2 | head -1`";
#finger -l $ENTRY | awk '{ print $2 }' | tail -2 | head -1;
done
echo "-----------------------\n";

echo "\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";



best,

-- Chandan Maddanna

Last edited by bakunin; 06-13-2009 at 01:44 AM.. Reason: added code-tags
  #4 (permalink)  
Old 01-16-2008
isobhi isobhi is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 2
Smile How to check free/total Memory in AIX

Hi

I tried the script,but it gave me some errors,I modified it a little bit this is the working version.


#!/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 "\n\n-----------------------";
echo " Users Login information \n";

for ENTRY in `finger | cut -d " " -f1 | grep -v Login | uniq`
do
echo "`finger -l $ENTRY | head -1 | cut -d \" \" -f14` ---> `finger -l $ENTRY |
awk '{ print $2 }' | tail -2 | head -1`";
#finger -l $ENTRY | awk '{ print $2 }' | tail -2 | head -1;
done
echo "-----------------------\n";

echo "\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";


regards
Ibrahim Sobhi
  #5 (permalink)  
Old 01-16-2008
chandan_m chandan_m is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 4
Thanks Ibrahim

Thanks Ibrahim.

Best,

-- Chandan
  #6 (permalink)  
Old 01-16-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
To get the total memory simply look for its attributes:

lsattr -El mem0

What exactly do you mean by "total memory" and "free memory"? The available physical RAM? The available space in RAM plus the available swap space (the virtual memory) ? Depending on what exactly you want to know you can use vmstat or svmon (only as root) with various options. You can also use topas, nmon or any other similar tool, because the numbers they show are available on public OS interfaces (read: system calls) which are just queried by these tools. The difference to svmon and vmstat is just the presentation of the data gathered this way.

You can also use "vmstat -v", just keep in mind that the number is shown in memory pages (in AIX this is 4k) instead of bytes or kilobytes. For example, a machine with 16GB RAM installed (i have marked bold the corresponding numbers for you):

Code:
# lsattr -El mem0
goodsize 16384 Amount of usable physical memory in Mbytes False
size     16384 Total amount of physical memory in Mbytes  False
# vmstat -v
              4194304 memory pages
              3977913 lruable pages
                19249 free pages
                    2 memory pools
               785742 pinned pages
                 80.0 maxpin percentage
                 20.0 minperm percentage
                 80.0 maxperm percentage
                 55.5 numperm percentage
              2210872 file pages
                  0.0 compressed percentage
                    0 compressed pages
                 55.5 numclient percentage
                 80.0 maxclient percentage
              2210872 client pages
                    0 remote pageouts scheduled
                 2422 pending disk I/Os blocked with no pbuf
              4976055 paging space I/Os blocked with no psbuf
                 2484 filesystem I/Os blocked with no fsbuf
                 8021 client filesystem I/Os blocked with no fsbuf
               101407 external pager filesystem I/Os blocked with no fsbuf
                    0 Virtualized Partition Memory Page Faults
                 0.00 Time resolving virtualized partition memory page faults
I hope this helps.

bakunin
  #7 (permalink)  
Old 01-16-2008
rbernste rbernste is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 1
You may want to download and use the "nmon" utility. It can be obtained from http://www-941.haw.ibm.com/collabora...WikiPtype/nmon

An introduction to "nmon" can be found at IBM Wikis - AIX 5L Wiki - nmon Introduction Workshop. The audio briefs under "Section 7 -nmon Frequently Asked Questions" can help you to better understand how AIX tries to use all available memory. Thus "no free memory" may not be bad, if it is being used as filesystem cache.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0