Visitors: 15543421
FAQ: How much memory? PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Michael Felt   

Admins and users frequently ask a variation of "How much memory is being used by ..." Below I will keep adding questions as I think of them (and/or get asked (again)).

Q. What options should I give to ps to show memory usage?

A. Don't bother Surprised - because you should switch to svmon when working on AIX. However, if you must have output compatible with another *NIX system - just use the same options on AIX as you do there. The columns will match up - but not necessarly the interpretation. The problem with ps these days come, in part, because the design of ps was back in the days before 'demand paging'. It is not impossible - but it is difficult to get an overview of - let's say exclusive memory usage. So - look to "How should I examine memory usage on AIX?"

Q. How should I examine memory usage on AIX?

A. The preferred program to use is svmon. The default output is to give a summary of the memory usage for whole system. Any user can use svmon - but only root or RBAC enabled users can see the data from other users. A regular user can only see statistics for their own processes.

Examples:

michael@x071:[/home/michael]id
uid=199(michael) gid=1(staff) groups=1(staff),33(httpd)
michael@x071:[/home/michael]svmon -G -O unit=MB
Unit: MB
--------------------------------------------------------------------------------------
               size       inuse        free         pin     virtual  available   mmode
memory      4096.00     3810.58      285.42      503.50     1051.61    2884.20     Ded
pg space    1024.00        10.3

               work        pers        clnt       other
pin          356.39           0        8.23      138.88
in use      1051.61           0     2758.96

michael@x071:[/home/michael]svmon -P -t 3 -O unit=MB
Unit: MB

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual
 5111976 sshd              93.1     53.3        0     92.5
 7340166 sshd              93.1     53.3        0     92.5
 7274520 sshd              93.1     53.3        0     92.5

michael@x071:[/home/michael]su -
root's Password:
root@x071:[/root]svmon -G -O unit=MB
Unit: MB
--------------------------------------------------------------------------------------
               size       inuse        free         pin     virtual  available   mmode
memory      4096.00     3811.25      284.75      503.58     1052.26    2883.55     Ded
pg space    1024.00        10.3

               work        pers        clnt       other
pin          356.47           0        8.23      138.88
in use      1052.26           0     2759.00

 

root@x071:[/root]svmon -P -t 3 -O unit=MB
Unit: MB

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual
11403298 httpd           676.31     53.3        0   118.94
 5243106 httpd           676.19     53.3        0   118.81
 8716510 httpd           676.06     53.3        0   118.69
 

Q. How can I get a human readable output from svmon?

A. The default output options of svmon are modified by the option '-O'. The first one I recommend you memorize is "-O unit=MB", Generally a report in MegaBytes is sufficient. You can also choose for GB - or auto. KB is also an option - I just never use it.

When 'unit=' is not specified the value is a page count. Unfortunately page counts can refer to different sizes (e.g., 4k and 64k) so it is conceivable that the numeric value 10 is smaller than 1 physically (10 x 4K is 40K compared to 1 x 64K).

Last thing to remember: when using 'unit=auto' all the values have 2-letter size value behind them. When using a 'static' size (e.g., MB) all values are rounded to the nearest unit. So, if you are worried about rounding effects - use auto or KB.

  Examples

michael@x071:[/home/michael]svmon -P -t 3 -O unit=auto
Unit: auto

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual
 5111976 sshd             93.1M    53.3M       0K    92.5M
 7340166 sshd             93.1M    53.3M       0K    92.5M
 7274520 sshd             93.1M    53.3M       0K    92.5M
michael@x071:[/home/michael]svmon -P -t 3 -O unit=KB
Unit: KB

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual
 5111976 sshd             95364    54544        0    94712
 7340166 sshd             95356    54544        0    94704
 7274520 sshd             95356    54544        0    94704
michael@x071:[/home/michael]svmon -P -t 3 -O unit=MB
Unit: MB

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual
 5111976 sshd              93.1     53.3        0     92.5
 7340166 sshd              93.1     53.3        0     92.5
 7274520 sshd              93.1     53.3        0     92.5
michael@x071:[/home/michael]svmon -P -t 3 -O unit=GB
Unit: GB

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual
 5111976 sshd              0.09     0.05        0     0.09
 7340166 sshd              0.09     0.05        0     0.09
 7274520 sshd              0.09     0.05        0     0.09

 

Q. How much memory I'm using is unique?

 A. With svmon that is fairly easy to establish. One option I tend to add always is -O unit={MB|GB} depending on system size. Just add the option filtercat=exclusive

Example

michael@x071:[/home/michael]svmon -P -t 3 -O unit=MB,filtercat=exclusive
Unit: MB

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual
 8716312 svmon             2.00     0.19        0     1.67
12386544 ksh               0.59     0.02        0     0.59
 4587748 ksh               0.59     0.02        0     0.59

 
Next >

Legacy PDFs

AIX 5.2
AIX 5.1