How to check free/total Memory in AIX


 
Thread Tools Search this Thread
Operating Systems AIX How to check free/total Memory in AIX
# 1  
Old 01-15-2008
Bug 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  
Old 01-16-2008
Bug 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  
Old 01-16-2008
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 02:44 AM.. Reason: added code-tags
# 4  
Old 01-16-2008
Bug 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  
Old 01-16-2008
Thanks Ibrahim

Thanks Ibrahim.

Best,

-- Chandan
# 6  
Old 01-16-2008
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  
Old 01-16-2008
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calculate total memory using free -m

Hi I am trying to calculate memory used by Linux System free -m total used free shared buffers cached Mem: 32109 31010 1099 0 3600 7287 -/+ buffers/cache: 20121 11987 Swap: 10239 1282 8957 Now according to my requirement Im calculating memory using below cmd free -m | awk 'NR==3{printf... (2 Replies)
Discussion started by: sam@sam
2 Replies

2. AIX

Process, PID and total memory consumed on AIX.

Hi, Below is the code snippet I use on Linux (Centos) to retrieve the Process Name, PID and memory consumed on Linux (Centos) host:- top -b -n 1 | awk -v date="$tdydate" -v ip="$ip" 'NR>7 {print date","ip","$12,","$1,","$10}' Any idea how the same can be retrieved on an AIX host? This... (1 Reply)
Discussion started by: Vipin Batra
1 Replies

3. AIX

High Paging when lots of free memory AIX 5.3

I am new to AIX, I have few AIX 5.3 servers and I could see there are significant difference in paging space utilization on servers even though they are running same applications below server is working fine which shows 2-5 % paging usage throuh out the day cpu_scale_memp = 8... (12 Replies)
Discussion started by: bibish
12 Replies

4. Shell Programming and Scripting

Nagios script to get total and free memory

Hi Experts, need some help. I`m trying to write a shell script to get free, used and total memory on our linux servers. It's working great, but i need follow some standards to make it a real nagios plugin. It's pretty simple, you just type two parameters to the script, check_ram -w 80 -c 90... (4 Replies)
Discussion started by: berveglieri
4 Replies

5. AIX

How much total and free memory I have in my aix 5.3 server?

good morning, how I can know how much total and free memory I have in my AIX 5.3 server, and this is shown in megabytes or gigabytes? Thank you very much. (4 Replies)
Discussion started by: systemoper
4 Replies

6. AIX

How to find AIX Free Memory?

All, AIX: 6.1 64 bits How to find out Free memory available on AIX 6.1 64 bits When I used : svmon -G size inuse free pin virtual mmode memory 1048576 612109 191151 215969 549824 Ded-E pg space 4325376 ... (1 Reply)
Discussion started by: a1_win
1 Replies

7. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

8. Solaris

how to get the more memory free space (see memory free column)

Hi all, Could please let me know how to get the more memory free space (not added the RAM) in local zone. -bash-3.00# vmstat 2 5 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr s0 s1 s1 s1 in sy cs us sy... (3 Replies)
Discussion started by: murthy76
3 Replies

9. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

10. AIX

Free Memory in aix

Hi, I want to know how to find out free physical memory in aix, (11 Replies)
Discussion started by: manoj.solaris
11 Replies
Login or Register to Ask a Question